-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
368 additions
and
54 deletions.
There are no files selected for viewing
This file contains 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 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,21 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class ColoredScrollableChild extends StatelessWidget { | ||
final Color color; | ||
final Widget child; | ||
const ColoredScrollableChild({ | ||
Key? key, | ||
required this.color, | ||
required this.child, | ||
}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Container( | ||
color: color, | ||
child: SingleChildScrollView( | ||
child: child, | ||
), | ||
); | ||
} | ||
} |
This file contains 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 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 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 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 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 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 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 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,96 @@ | ||
import 'package:aralan/elements/colored_scrollable_child.dart'; | ||
import 'package:aralan/elements/navigation_button.dart'; | ||
import 'package:aralan/pages/settings_pages/available_activities.dart'; | ||
import 'package:aralan/pages/settings_pages/daily_activities.dart'; | ||
import 'package:aralan/pages/settings_pages/todays_activities.dart'; | ||
import 'package:aralan/pages/test_page.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class SettingsPage extends StatefulWidget { | ||
const SettingsPage({Key? key}) : super(key: key); | ||
|
||
@override | ||
State<SettingsPage> createState() => _SettingsPageState(); | ||
} | ||
|
||
class _SettingsPageState extends State<SettingsPage> { | ||
int _selectedIndex = 0; | ||
PageController pageController = PageController(); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
// var theme = Theme.of(context); | ||
|
||
return Scaffold( | ||
body: Row( | ||
children: [ | ||
NavigationRail( | ||
selectedIndex: _selectedIndex, | ||
leading: NavigationButton( | ||
positioned: false, | ||
icon: Icons.arrow_back, | ||
onPressed: () => {Navigator.pop(context)}, | ||
), | ||
extended: true, | ||
onDestinationSelected: (index) { | ||
if (index == 3) { | ||
Navigator.push( | ||
context, | ||
MaterialPageRoute(builder: (context) => const TestPage()), | ||
); | ||
return; | ||
} | ||
setState(() { | ||
_selectedIndex = index; | ||
pageController.animateToPage( | ||
index, | ||
duration: const Duration(milliseconds: 200), | ||
curve: Curves.easeIn, | ||
); | ||
}); | ||
}, | ||
// labelType: NavigationRailLabelType.all, | ||
destinations: const [ | ||
NavigationRailDestination( | ||
icon: Icon(Icons.today), | ||
label: Text('Today'), | ||
), | ||
NavigationRailDestination( | ||
icon: Icon(Icons.view_list_outlined), | ||
label: Text('Daily'), | ||
), | ||
NavigationRailDestination( | ||
icon: Icon(Icons.list), | ||
label: Text('Available'), | ||
), | ||
NavigationRailDestination( | ||
icon: Icon(Icons.church), | ||
label: Text('Testing'), | ||
), | ||
], | ||
), | ||
Expanded( | ||
child: PageView( | ||
controller: pageController, | ||
scrollDirection: Axis.horizontal, | ||
children: const [ | ||
ColoredScrollableChild( | ||
color: Colors.blue, | ||
child: TodaysActivities(), | ||
), | ||
ColoredScrollableChild( | ||
color: Colors.green, | ||
child: DailyActivities(), | ||
), | ||
ColoredScrollableChild( | ||
color: Colors.indigo, | ||
child: AvailableActivities(), | ||
), | ||
], | ||
), | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} |
This file contains 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
Oops, something went wrong.