Skip to content

Commit

Permalink
Gridview in the home page with navigation options
Browse files Browse the repository at this point in the history
  • Loading branch information
DariusIMP committed Mar 6, 2022
1 parent 209b98c commit bca46a5
Show file tree
Hide file tree
Showing 6 changed files with 161 additions and 26 deletions.
Binary file added assets/images/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/images/waving_hand.png
Binary file not shown.
10 changes: 4 additions & 6 deletions lib/navigation/navigation_drawer.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:lsa_gloves/pages/ble_data_collection_page.dart';
import 'package:lsa_gloves/pages/ble_devices_connection_page.dart';
import 'package:lsa_gloves/connection/wifi/socket.dart';
import 'package:lsa_gloves/pages/data_visualization_page.dart';
import 'package:lsa_gloves/pages/file_manager_page.dart';
import 'package:lsa_gloves/pages/interpretation_page.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';

class NavDrawer extends StatelessWidget {
const NavDrawer({Key? key}) : super(key: key);
Expand Down Expand Up @@ -44,10 +44,7 @@ class NavDrawer extends StatelessWidget {
builder: (context) => FileManagerPage(), maintainState: false));
}),
ListTile(
leading: Container(
width: 25,
height: 25,
child: ImageIcon(AssetImage("assets/images/waving_hand.png"))),
leading: Icon(MdiIcons.handWaveOutline),
title: const Text("Recolectar data"),
onTap: () {
Navigator.of(context).push(MaterialPageRoute(
Expand All @@ -67,7 +64,8 @@ class NavDrawer extends StatelessWidget {
title: const Text("Interpretación"),
onTap: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => InterpretationPage(), maintainState: false));
builder: (context) => InterpretationPage(),
maintainState: false));
})
]));
}
Expand Down
150 changes: 139 additions & 11 deletions lib/pages/home_page.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
import '../navigation/navigation_drawer.dart';
import 'ble_data_collection_page.dart';
import 'ble_devices_connection_page.dart';
import 'data_visualization_page.dart';
import 'file_manager_page.dart';
import 'interpretation_page.dart';

class HomePage extends StatefulWidget {
const HomePage({Key? key}) : super(key: key);
Expand All @@ -11,18 +16,141 @@ class HomePage extends StatefulWidget {
}

class _HomePageState extends State<HomePage> {

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('LSA Gloves'),
),
drawer: NavDrawer(),
body: Center(
child: Text("QUE PONEMOS EN LA HOME ??"),
));
appBar: AppBar(
title: Text('LSA Gloves'),
),
drawer: NavDrawer(),
body: Center(
child: GridView.count(
primary: false,
padding: const EdgeInsets.all(8),
crossAxisSpacing: 10,
mainAxisSpacing: 10,
crossAxisCount: 2,
children: <Widget>[
ElevatedButton(
onPressed: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => BleGloveConnectionPage(),
maintainState: false));
},
child: Container(
padding: const EdgeInsets.all(8),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Icon(Icons.bluetooth, size: 100),
Text(
"Conexión",
textScaleFactor: 1.5,
)
],
),
)),
ElevatedButton(
onPressed: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => FileManagerPage(),
maintainState: false));
},
child: Container(
padding: const EdgeInsets.all(8),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Icon(Icons.file_copy_outlined, size: 100),
Text(
"Archivos",
textScaleFactor: 1.5,
)
],
),
)),
ElevatedButton(
onPressed: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => InterpretationPage(),
maintainState: false));
},
child: Container(
padding: const EdgeInsets.all(8),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Icon(Icons.translate, size: 100),
Text(
"Interpretación",
textScaleFactor: 1.5,
)
],
),
)),
ElevatedButton(
onPressed: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => BleDataCollectionPage(),
maintainState: false));
},
child: Container(
padding: const EdgeInsets.all(8),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Icon(
MdiIcons.handWaveOutline,
size: 100,
),
Text(
"Recolección",
textScaleFactor: 1.5,
)
],
),
)),
ElevatedButton(
onPressed: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => DataVisualizationPage(),
maintainState: false));
},
child: Container(
padding: const EdgeInsets.all(8),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Icon(
MdiIcons.chartLine,
size: 100,
),
Text(
"Visualizador",
textScaleFactor: 1.5,
)
],
),
)),
ElevatedButton(
onPressed: () => {},
child: Container(
padding: const EdgeInsets.all(8),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Icon(
MdiIcons.informationOutline,
size: 100,
),
Text(
"Acerca",
textScaleFactor: 1.5,
)
],
),
)),
],
)));
}


}
23 changes: 15 additions & 8 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.6.1"
version: "2.8.2"
boolean_selector:
dependency: transitive
description:
Expand All @@ -42,14 +42,14 @@ packages:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
version: "1.2.0"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
version: "1.3.1"
clock:
dependency: transitive
description:
Expand Down Expand Up @@ -162,14 +162,21 @@ packages:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.10"
version: "0.12.11"
material_design_icons_flutter:
dependency: "direct main"
description:
name: material_design_icons_flutter
url: "https://pub.dartlang.org"
source: hosted
version: "5.0.6595"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
version: "1.7.0"
nested:
dependency: transitive
description:
Expand Down Expand Up @@ -349,7 +356,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.0"
version: "0.4.3"
typed_data:
dependency: transitive
description:
Expand All @@ -370,7 +377,7 @@ packages:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
version: "2.1.1"
win32:
dependency: transitive
description:
Expand All @@ -386,5 +393,5 @@ packages:
source: hosted
version: "0.2.0"
sdks:
dart: ">=2.13.0 <3.0.0"
dart: ">=2.14.0 <3.0.0"
flutter: ">=2.0.0"
4 changes: 3 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ dependencies:
synchronized: ^3.0.0
syncfusion_flutter_charts: ^19.3.45
intl: "^0.17.0"
material_design_icons_flutter: 5.0.6595


dev_dependencies:
flutter_test:
Expand All @@ -58,7 +60,7 @@ flutter:
- assets/audios/
- assets/secrets.json
- assets/images/
- assets/images/waving_hand.png
- assets/images/ic_launcher.png

# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware.
Expand Down

0 comments on commit bca46a5

Please sign in to comment.