-
Notifications
You must be signed in to change notification settings - Fork 3
Mobile/record sleep scaffold #54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
80675bb
Adding NavDrawer base
bb32cca
Fixing conflicts with bluetooth merge
9324a60
Adding auto_route
12f76b0
Adding .workspace to gitignore
c56840e
End of navdrawer base
8973d4c
Record sleep sample page
1d9399a
added assets directory
46201f2
auto_route code generated class
8cce627
App icon exports
52e42bd
record sleep pages
499dd6e
navigation drawer page & bloc
03fe21c
renaming bluetooth stuff
f505f6e
blocs barrel file for exports
e7f35f7
adding dashboard page
cd46f17
adding assets and app icon to pubspect file
16bbe80
unused import
45679e8
NavDrawer with selection
mateobelanger 06311d6
added pageView slider to sleep guide
mateobelanger 626b1a2
adding sliverbar to dashboard
mateobelanger 1b7e7bf
removed unused file
mateobelanger f3d696b
adding mock chart
mateobelanger 39e4b47
Merge remote-tracking branch 'origin/master' into mobile/record-sleep…
1fdf509
Various lint fixes
a117972
Update .gitignore
mateobelanger 92e68ea
Update .gitignore
mateobelanger 4fbeabe
Update mobile/lib/src/application/navdrawer/navdrawer_bloc.dart
mateobelanger d2cb47c
Nit fixes for pull request
aaa10ab
NavDrawer fix to respect stateless widget coherence
be75b77
typo in workflow file
acb8494
Update router.dart
mateobelanger 930a148
Revert "adding mock chart"
54fd08e
Merge remote-tracking branch 'origin/mobile/record-sleep-scaffold' in…
21d85e1
Fixes to temporarily remove Charts package
9a99b06
Removed polydodo-mobile.workspace and moved to private settings file
496ef2f
Keeping launch.json mobile config file
9e69354
Fix git bug
abelfodil d788a79
Delete .gitignore
abelfodil aa21ee2
Smoother animations for Navdrawer
35d50b0
Navdrawer without bloc
6c29255
Update README.md
mateobelanger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+1.34 KB
(350%)
mobile/android/app/src/main/res/mipmap-hdpi/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 modified
BIN
+785 Bytes
(280%)
mobile/android/app/src/main/res/mipmap-mdpi/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 modified
BIN
+2.02 KB
(390%)
mobile/android/app/src/main/res/mipmap-xhdpi/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 modified
BIN
+3.5 KB
(450%)
mobile/android/app/src/main/res/mipmap-xxhdpi/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 modified
BIN
+5.3 KB
(480%)
mobile/android/app/src/main/res/mipmap-xxxhdpi/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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| export './device/device_selector_cubit.dart'; | ||
| export './eeg_data/data_cubit.dart'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| part of './data_cubit.dart'; | ||
|
|
||
| abstract class DataState {} | ||
|
|
||
| class DataStateInitial extends DataState {} | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| enum NavdrawerTab { Dashboard, RecordSleep, BluetoothSelector, History } |
90 changes: 90 additions & 0 deletions
90
mobile/lib/src/presentation/navigation/navdrawer_widget.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| import 'package:auto_route/auto_route.dart'; | ||
| import 'package:flutter/material.dart'; | ||
| import 'package:polydodo/src/presentation/navigation/routes/router.gr.dart'; | ||
|
|
||
| import 'navdrawer_tabs.dart'; | ||
|
|
||
| class NavDrawer extends StatelessWidget { | ||
| static const name = 'appDrawerRoute'; | ||
| final NavdrawerTab activeTab; | ||
|
|
||
| const NavDrawer({ | ||
| Key key, | ||
| @required this.activeTab, | ||
| }) : super(key: key); | ||
|
|
||
| @override | ||
| Widget build(BuildContext context) { | ||
| return Drawer( | ||
| child: ListView( | ||
| padding: EdgeInsets.zero, //only(top: 8.0), | ||
| children: <Widget>[ | ||
| _createHeader(), | ||
| _createDrawerItem( | ||
| icon: Icons.dashboard, | ||
| text: 'Dashboard', | ||
| route: Routes.dashboardPage, | ||
| context: context, | ||
| ), | ||
| _createDrawerItem( | ||
| icon: Icons.bluetooth, | ||
| text: 'Bluetooth selector', | ||
| route: Routes.bluetoothSelectorPage, | ||
| context: context, | ||
| ), | ||
| _createDrawerItem( | ||
| icon: Icons.hotel, | ||
| text: 'Record Sleep sequence', | ||
| route: Routes.recordSleepGuidePage, | ||
| context: context, | ||
| ), | ||
| ], | ||
| ), | ||
| ); | ||
| } | ||
|
|
||
| Widget _createHeader() { | ||
| return DrawerHeader( | ||
| margin: EdgeInsets.zero, | ||
| padding: EdgeInsets.zero, | ||
| decoration: BoxDecoration( | ||
| image: DecorationImage( | ||
| fit: BoxFit.fill, | ||
| image: AssetImage('common/assets/img/Material-Wallpaper.jpg'))), | ||
| child: Stack(children: <Widget>[ | ||
| Positioned( | ||
| bottom: 12.0, | ||
| left: 16.0, | ||
| child: Text('Polydodo', | ||
| style: TextStyle( | ||
| color: Colors.white, | ||
| fontSize: 20.0, | ||
| fontWeight: FontWeight.w500))), | ||
| ])); | ||
| } | ||
|
|
||
| Widget _createDrawerItem( | ||
| {IconData icon, | ||
| String text, | ||
| NavdrawerTab tab, | ||
| String route, | ||
| BuildContext context}) { | ||
| return ListTile( | ||
| title: Row( | ||
| children: <Widget>[ | ||
| Icon(icon), | ||
| Padding( | ||
| padding: EdgeInsets.only(left: 8.0), | ||
| child: Text(text), | ||
| ) | ||
| ], | ||
| ), | ||
| onTap: () { | ||
| //context.bloc<NavdrawerBloc>().add(NavdrawerUpdated(state)); | ||
| ExtendedNavigator.of(context).popAndPush(route); | ||
| // ExtendedNavigator.of(context).replace(route); | ||
| }, | ||
| selected: activeTab == tab, | ||
| ); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| import 'package:auto_route/auto_route.dart'; | ||
| import 'package:auto_route/auto_route_annotations.dart'; | ||
| import 'package:polydodo/src/presentation/pages/bluetooth_page/bluetoothSelector_page.dart'; | ||
| import 'package:polydodo/src/presentation/pages/dashboard/dashboard_page.dart'; | ||
| import 'package:polydodo/src/presentation/pages/record_sleep/record_sleep_guide_page.dart'; | ||
|
|
||
| @MaterialAutoRouter( | ||
| generateNavigationHelperExtension: true, | ||
| routes: <AutoRoute>[ | ||
| CustomRoute( | ||
| page: DashboardPage, | ||
| initial: true, | ||
| transitionsBuilder: TransitionsBuilders.fadeIn), | ||
| CustomRoute( | ||
| page: RecordSleepGuidePage, | ||
| transitionsBuilder: TransitionsBuilders.fadeIn), | ||
| CustomRoute( | ||
| page: RecordSleepValidatePage, | ||
| transitionsBuilder: TransitionsBuilders.fadeIn), | ||
| CustomRoute( | ||
| page: BluetoothSelectorPage, | ||
| transitionsBuilder: TransitionsBuilders.fadeIn), | ||
| ]) | ||
| class $Router {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
mobile/lib/src/presentation/pages/dashboard/dashboard_page.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| import 'package:flutter/material.dart'; | ||
| import 'package:polydodo/src/presentation/navigation/navdrawer_tabs.dart'; | ||
| import 'package:polydodo/src/presentation/navigation/navdrawer_widget.dart'; | ||
|
|
||
| class DashboardPage extends StatelessWidget { | ||
| @override | ||
| Widget build(BuildContext context) { | ||
| return Scaffold( | ||
| // appBar: AppBar(title: Text('Polydodo')), | ||
| drawer: NavDrawer(activeTab: NavdrawerTab.Dashboard), | ||
| body: NestedScrollView( | ||
| headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) { | ||
| return <Widget>[ | ||
| SliverAppBar( | ||
| expandedHeight: 200.0, | ||
| floating: false, | ||
| pinned: true, | ||
| flexibleSpace: FlexibleSpaceBar( | ||
| centerTitle: false, | ||
| title: Text('Polydodo', | ||
| style: TextStyle( | ||
| color: Colors.white, | ||
| fontSize: 16.0, | ||
| )), | ||
| background: Image.network( | ||
| 'https://images.pexels.com/photos/396547/pexels-photo-396547.jpeg?auto=compress&cs=tinysrgb&h=350', | ||
| fit: BoxFit.cover, | ||
| )), | ||
| ), | ||
| ]; | ||
| }, | ||
| body: Center( | ||
| child: Padding( | ||
| padding: EdgeInsets.symmetric(horizontal: 50), | ||
| child: Padding( | ||
| padding: EdgeInsets.symmetric(vertical: 200), | ||
| child: Text('Dashboard')), | ||
| ), | ||
| ), | ||
| ), | ||
| ); | ||
| } | ||
| } |
33 changes: 33 additions & 0 deletions
33
mobile/lib/src/presentation/pages/record_sleep/record_sleep_guide_page.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| import 'package:auto_route/auto_route.dart'; | ||
| import 'package:flutter/material.dart'; | ||
| import 'package:flutter_bloc/flutter_bloc.dart'; | ||
| import 'package:polydodo/src/application/eeg_data/data_cubit.dart'; | ||
| import 'package:polydodo/src/presentation/navigation/navdrawer_tabs.dart'; | ||
| import 'package:polydodo/src/presentation/navigation/navdrawer_widget.dart'; | ||
| import 'package:polydodo/src/presentation/navigation/routes/router.gr.dart'; | ||
|
|
||
| part 'record_sleep_recording_page.dart'; | ||
| part 'record_sleep_validate_page.dart'; | ||
|
|
||
| class RecordSleepGuidePage extends StatelessWidget { | ||
| @override | ||
| Widget build(BuildContext context) { | ||
| return Scaffold( | ||
| appBar: AppBar(title: Text('Record Sleep')), | ||
| drawer: NavDrawer(activeTab: NavdrawerTab.RecordSleep), | ||
| body: PageView( | ||
| children: [ | ||
| Container(child: Center(child: Text('Record Sleep Guide'))), | ||
| Container(child: Center(child: Text('Record Sleep next'))), | ||
| ], | ||
| ), | ||
| floatingActionButton: FloatingActionButton.extended( | ||
| onPressed: () { | ||
| ExtendedNavigator.of(context).replace(Routes.recordSleepValidatePage); | ||
| }, | ||
| icon: Icon(Icons.radio_button_checked), | ||
| label: Text('Record'), | ||
| ), | ||
| ); | ||
| } | ||
| } |
1 change: 1 addition & 0 deletions
1
mobile/lib/src/presentation/pages/record_sleep/record_sleep_recording_page.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| part of 'record_sleep_guide_page.dart'; |
18 changes: 4 additions & 14 deletions
18
...esentation/recording/recording_route.dart → ...ord_sleep/record_sleep_validate_page.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.