diff --git a/lib/presentation/molecules/energy_selection_molecule.dart b/lib/presentation/molecules/energy_selection_molecule.dart index b91ba9c..c82bd65 100644 --- a/lib/presentation/molecules/energy_selection_molecule.dart +++ b/lib/presentation/molecules/energy_selection_molecule.dart @@ -39,16 +39,17 @@ class _EnergySelectionMoleculeState extends State { Widget energyWidget(EnergyType type) { final EnergyLevel timerStatesTemp = EnergyLevel.fromEnergyType(type); - String subtitle = ''; + final StringBuffer subtitleBuffer = StringBuffer(); final TimerSession firstTimerState = timerStatesTemp.sessions.first; for (final TimerSession timerState in timerStatesTemp.sessions) { if (timerState != firstTimerState) { - subtitle += ' -> '; + subtitleBuffer.write(' -> '); } - subtitle = - '$subtitle${timerState.study.inMinutes}m study -> ${timerState.breakDuration.inMinutes}m break'; + subtitleBuffer.write( + '${timerState.study.inMinutes}m study -> ${timerState.breakDuration.inMinutes}m break', + ); } final bool showTipButton = timerStatesTemp.type.tipsId != null && @@ -61,7 +62,7 @@ class _EnergySelectionMoleculeState extends State { }, child: ListTileAtom( '${type.previewName.tr()} - ${type.duration.inMinutes}${'minutes_single'.tr()}', - subtitle: subtitle, + subtitle: subtitleBuffer.toString(), leading: Radio( value: type, groupValue: timerStates.type, diff --git a/lib/presentation/pages/home_page.dart b/lib/presentation/pages/home_page.dart index b1663b4..9da1a88 100644 --- a/lib/presentation/pages/home_page.dart +++ b/lib/presentation/pages/home_page.dart @@ -30,8 +30,9 @@ class _HomePageState extends State with WidgetsBindingObserver { super.initState(); WidgetsBinding.instance.addObserver(this); PlayerController.instance.setIsSound( - PreferencesController.instance.getBool(PreferenceKeys.isSound.name) ?? - true); + PreferencesController.instance.getBool(PreferenceKeys.isSound.name) ?? + true, + ); PlayerController.instance.play('start_session.wav'); VibrationController.instance.vibrate(VibrationType.heavy); TimerStateManager.iterateOverTimerStates(); @@ -93,7 +94,9 @@ class _HomePageState extends State with WidgetsBindingObserver { PreferencesController.instance .setDateTime(PreferenceKeys.pausedTime.name, DateTime.now()); PreferencesController.instance.setString( - PreferenceKeys.timerState.name, TimerStateManager.state.name); + PreferenceKeys.timerState.name, + TimerStateManager.state.name, + ); PreferencesController.instance.setDuration( PreferenceKeys.remainingTimerTime.name, TimerStateManager.remainingTime ?? Duration.zero,