Skip to content

Commit

Permalink
Dev chto (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
bootloopmaster636 committed Oct 15, 2023
1 parent 690366f commit fe38637
Show file tree
Hide file tree
Showing 4 changed files with 401 additions and 173 deletions.
39 changes: 39 additions & 0 deletions lib/displayLayers/OverlayLayer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ class SettingsPanelInside extends ConsumerWidget {
AssistTimerSection(),
BonusTimerSection(),
CutOffTimerSection(),
StartAtSection(),
SectionTitle(title: "Display"),
ThemeModeSection(),
DisplayScaleFactorSection(),
Expand Down Expand Up @@ -221,6 +222,44 @@ class TitleSection extends ConsumerWidget {
}
}

class StartAtSection extends ConsumerWidget {
const StartAtSection({super.key});

@override
Widget build(BuildContext context, WidgetRef ref) {
final timerWatcher = ref.watch(timerProvider);
final timerManager = ref.watch(timerProvider).timerManager;

return Card(
child: Column(
children: [
ListTile(
title: const Text("Start timer at"),
subtitle: const Text("Will start timer automatically at this time"),
trailing: Switch(
value: ref.watch(timerProvider).isAutoStartEnabled,
onChanged: (value) {
ref.read(timerProvider).toggleAutoStart();
},
),
),
ListTile(
enabled: ref.watch(timerProvider).isAutoStartEnabled,
title: const Text("Set time"),
trailing: Text(
"${ref.watch(timerProvider).autoStartTime.hour.toString().padLeft(2, '0')} : ${ref.watch(timerProvider).autoStartTime.minute.toString().padLeft(2, '0')}",
style: const TextStyle(fontSize: 20),
),
onTap: () async {
ref.read(timerProvider).setStartAt(await showTimePickerDialog(context));
},
),
],
),
);
}
}

class MainTimerSection extends ConsumerWidget {
const MainTimerSection({super.key});

Expand Down
Loading

0 comments on commit fe38637

Please sign in to comment.