diff --git a/lib/presentation/atoms/progress_tracker_atom.dart b/lib/presentation/atoms/progress_tracker_atom.dart new file mode 100644 index 0000000..2c01f04 --- /dev/null +++ b/lib/presentation/atoms/progress_tracker_atom.dart @@ -0,0 +1,40 @@ +import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:progress_tracker/progress_tracker.dart'; + +class ProgressTrackerAtom extends StatelessWidget { + const ProgressTrackerAtom(this.states, this.currentState); + + final List states; + final String currentState; + + @override + Widget build(BuildContext context) { + final int currentIndex = states.indexOf(currentState); + final List statusList = []; + bool active = true; + + for (final String state in states) { + statusList.add( + Status( + name: state, + icon: state == currentState ? FontAwesomeIcons.caretDown : null, + active: active, + ), + ); + if (state == currentState) { + active = false; + } + } + + final ThemeData themeData = Theme.of(context); + final ColorScheme colorScheme = themeData.colorScheme; + + return ProgressTracker( + currentIndex: currentIndex, + statusList: statusList, + activeColor: colorScheme.onSurface, + inActiveColor: colorScheme.outlineVariant, + ); + } +} diff --git a/lib/presentation/molecules/bottom_navigation_bar_home_molecule.dart b/lib/presentation/molecules/bottom_navigation_bar_home_molecule.dart index 4b58bb2..daccb0b 100644 --- a/lib/presentation/molecules/bottom_navigation_bar_home_molecule.dart +++ b/lib/presentation/molecules/bottom_navigation_bar_home_molecule.dart @@ -13,7 +13,7 @@ class BottomNavigationBarHomePage extends StatelessWidget { final ColorScheme colorScheme = themeData.colorScheme; return BottomNavigationBar( - selectedItemColor: colorScheme.onSurface, + selectedItemColor: colorScheme.primary, unselectedItemColor: colorScheme.onSurfaceVariant, currentIndex: pageIndex, onTap: callback, diff --git a/lib/presentation/molecules/page_enclosure_molecule.dart b/lib/presentation/molecules/page_enclosure_molecule.dart index b88c2cf..afa8b42 100644 --- a/lib/presentation/molecules/page_enclosure_molecule.dart +++ b/lib/presentation/molecules/page_enclosure_molecule.dart @@ -8,6 +8,7 @@ class PageEnclosureMolecule extends StatelessWidget { required this.child, this.subTitle, this.margin = true, + this.topMargin = true, this.topBarTranslate = true, this.topBarType = TopBarType.none, this.scaffold = true, @@ -21,6 +22,7 @@ class PageEnclosureMolecule extends StatelessWidget { final String? subTitle; final bool topBarTranslate; final bool margin; + final bool topMargin; final bool scaffold; final TopBarType topBarType; final VoidCallback? topBarRightOnTap; @@ -41,7 +43,7 @@ class PageEnclosureMolecule extends StatelessWidget { subTitle!, variant: TextVariant.smallTitle, ), - const SeparatorAtom(variant: SeparatorVariant.farApart), + if (topMargin) const SeparatorAtom(variant: SeparatorVariant.farApart), Expanded( child: child, ), diff --git a/lib/presentation/organisms/timer_organism.dart b/lib/presentation/organisms/timer_organism.dart index 0a1b9ba..9dbe2ca 100644 --- a/lib/presentation/organisms/timer_organism.dart +++ b/lib/presentation/organisms/timer_organism.dart @@ -4,6 +4,7 @@ import 'package:flutter/material.dart'; import 'package:infinite_horizons/domain/controllers/controllers.dart'; import 'package:infinite_horizons/domain/objects/energy_level.dart'; import 'package:infinite_horizons/domain/objects/study_type_abstract.dart'; +import 'package:infinite_horizons/presentation/atoms/progress_tracker_atom.dart'; import 'package:infinite_horizons/presentation/molecules/molecules.dart'; import 'package:infinite_horizons/presentation/organisms/organisms.dart'; import 'package:infinite_horizons/presentation/pages/pages.dart'; @@ -225,18 +226,33 @@ class TimerOrganismState extends State { title: title, scaffold: false, expendChild: false, + topMargin: false, topBarRightOnTap: () => openAlertDialog(context, SettingsPage()), - child: renderSizedBox ? const SizedBox() : stateWidget(), + child: Column( + children: [ + ProgressTrackerAtom( + TimerState.values.map((e) => e.spacedName).toList(), + state.spacedName, + ), + Expanded( + child: renderSizedBox ? const SizedBox() : stateWidget(), + ), + ], + ), ); } } enum TimerState { - study, - getReadyForBreak, - breakTime, - readyToStart, + study('Study'), + getReadyForBreak('Before Break'), + breakTime('Break Time'), + readyToStart('Complete'), ; + + const TimerState(this.spacedName); + + final String spacedName; } extension TimerStateExtension on TimerState { diff --git a/lib/presentation/pages/intro_page.dart b/lib/presentation/pages/intro_page.dart index 6dd0554..19be2e1 100644 --- a/lib/presentation/pages/intro_page.dart +++ b/lib/presentation/pages/intro_page.dart @@ -132,6 +132,7 @@ class _IntroPageState extends State { scrollPhysics: const NeverScrollableScrollPhysics(), onChange: onIntroPageChange, showDoneButton: false, + showNextButton: showNextButton, ), ), ); diff --git a/pubspec.yaml b/pubspec.yaml index 4709453..e3b22df 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -38,6 +38,10 @@ dependencies: liquid_progress_indicator_v2: ^0.5.0 logger: ^2.2.0 permission_handler: ^11.3.1 + progress_tracker: + git: + url: https://github.com/guyluz11/progress-tracker.git + ref: main shared_preferences: ^2.2.3 url_launcher: ^6.2.6 vibration: ^1.8.4