Skip to content

Commit

Permalink
refactor: remove unused IconButton and update sleep timer preset dura…
Browse files Browse the repository at this point in the history
…tions
  • Loading branch information
Dr-Blank committed Oct 2, 2024
1 parent 4a706a9 commit f5d300a
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 10 deletions.
14 changes: 7 additions & 7 deletions lib/features/player/view/player_when_expanded.dart
Original file line number Diff line number Diff line change
Expand Up @@ -240,13 +240,13 @@ class PlayerWhenExpanded extends HookConsumerWidget {
// chapter list
const ChapterSelectionButton(),
// settings
IconButton(
icon: const Icon(Icons.more_horiz),
onPressed: () {
// show toast
showNotImplementedToast(context);
},
),
// IconButton(
// icon: const Icon(Icons.more_horiz),
// onPressed: () {
// // show toast
// showNotImplementedToast(context);
// },
// ),
],
),
),
Expand Down
5 changes: 3 additions & 2 deletions lib/features/sleep_timer/view/sleep_timer_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:list_wheel_scroll_view_nls/list_wheel_scroll_view_nls.dart';
import 'package:material_symbols_icons/symbols.dart';
import 'package:vaani/features/player/view/player_when_expanded.dart';
import 'package:vaani/features/player/view/widgets/speed_selector.dart';
import 'package:vaani/features/sleep_timer/core/sleep_timer.dart';
Expand Down Expand Up @@ -54,7 +55,7 @@ class SleepTimerButton extends HookConsumerWidget {
duration: const Duration(milliseconds: 300),
child: sleepTimer == null
? Icon(
Icons.timer_rounded,
Symbols.bedtime,
color: Theme.of(context).colorScheme.onSurface,
)
: RemainingSleepTimeDisplay(
Expand Down Expand Up @@ -153,7 +154,7 @@ class SleepTimerBottomSheet extends HookConsumerWidget {
onDurationSelected?.call(null);
Navigator.of(context).pop();
},
icon: const Icon(Icons.timer_off),
icon: const Icon(Symbols.bedtime_off),
label: const Text('Cancel Sleep Timer'),
),
),
Expand Down
8 changes: 7 additions & 1 deletion lib/settings/models/app_settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,13 @@ class SleepTimerSettings with _$SleepTimerSettings {
const factory SleepTimerSettings({
@Default(Duration(minutes: 15)) Duration defaultDuration,
@Default(
[Duration(minutes: 5), Duration(minutes: 15), Duration(minutes: 30)],
[
Duration(minutes: 5),
Duration(minutes: 10),
Duration(minutes: 15),
Duration(minutes: 20),
Duration(minutes: 30),
],
)
List<Duration> presetDurations,
@Default(Duration(minutes: 100)) Duration maxDuration,
Expand Down
2 changes: 2 additions & 0 deletions lib/settings/models/app_settings.freezed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1612,7 +1612,9 @@ class _$SleepTimerSettingsImpl implements _SleepTimerSettings {
{this.defaultDuration = const Duration(minutes: 15),
final List<Duration> presetDurations = const [
Duration(minutes: 5),
Duration(minutes: 10),
Duration(minutes: 15),
Duration(minutes: 20),
Duration(minutes: 30)
],
this.maxDuration = const Duration(minutes: 100),
Expand Down
2 changes: 2 additions & 0 deletions lib/settings/models/app_settings.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f5d300a

Please sign in to comment.