mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2026-07-07 01:41:33 +00:00
refactor: remove unused IconButton and update sleep timer preset durations
This commit is contained in:
parent
4a706a958e
commit
f5d300a1a5
5 changed files with 21 additions and 10 deletions
|
|
@ -240,13 +240,13 @@ class PlayerWhenExpanded extends HookConsumerWidget {
|
||||||
// chapter list
|
// chapter list
|
||||||
const ChapterSelectionButton(),
|
const ChapterSelectionButton(),
|
||||||
// settings
|
// settings
|
||||||
IconButton(
|
// IconButton(
|
||||||
icon: const Icon(Icons.more_horiz),
|
// icon: const Icon(Icons.more_horiz),
|
||||||
onPressed: () {
|
// onPressed: () {
|
||||||
// show toast
|
// // show toast
|
||||||
showNotImplementedToast(context);
|
// showNotImplementedToast(context);
|
||||||
},
|
// },
|
||||||
),
|
// ),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
import 'package:list_wheel_scroll_view_nls/list_wheel_scroll_view_nls.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/player_when_expanded.dart';
|
||||||
import 'package:vaani/features/player/view/widgets/speed_selector.dart';
|
import 'package:vaani/features/player/view/widgets/speed_selector.dart';
|
||||||
import 'package:vaani/features/sleep_timer/core/sleep_timer.dart';
|
import 'package:vaani/features/sleep_timer/core/sleep_timer.dart';
|
||||||
|
|
@ -54,7 +55,7 @@ class SleepTimerButton extends HookConsumerWidget {
|
||||||
duration: const Duration(milliseconds: 300),
|
duration: const Duration(milliseconds: 300),
|
||||||
child: sleepTimer == null
|
child: sleepTimer == null
|
||||||
? Icon(
|
? Icon(
|
||||||
Icons.timer_rounded,
|
Symbols.bedtime,
|
||||||
color: Theme.of(context).colorScheme.onSurface,
|
color: Theme.of(context).colorScheme.onSurface,
|
||||||
)
|
)
|
||||||
: RemainingSleepTimeDisplay(
|
: RemainingSleepTimeDisplay(
|
||||||
|
|
@ -153,7 +154,7 @@ class SleepTimerBottomSheet extends HookConsumerWidget {
|
||||||
onDurationSelected?.call(null);
|
onDurationSelected?.call(null);
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
},
|
},
|
||||||
icon: const Icon(Icons.timer_off),
|
icon: const Icon(Symbols.bedtime_off),
|
||||||
label: const Text('Cancel Sleep Timer'),
|
label: const Text('Cancel Sleep Timer'),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,13 @@ class SleepTimerSettings with _$SleepTimerSettings {
|
||||||
const factory SleepTimerSettings({
|
const factory SleepTimerSettings({
|
||||||
@Default(Duration(minutes: 15)) Duration defaultDuration,
|
@Default(Duration(minutes: 15)) Duration defaultDuration,
|
||||||
@Default(
|
@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,
|
List<Duration> presetDurations,
|
||||||
@Default(Duration(minutes: 100)) Duration maxDuration,
|
@Default(Duration(minutes: 100)) Duration maxDuration,
|
||||||
|
|
|
||||||
|
|
@ -1612,7 +1612,9 @@ class _$SleepTimerSettingsImpl implements _SleepTimerSettings {
|
||||||
{this.defaultDuration = const Duration(minutes: 15),
|
{this.defaultDuration = const Duration(minutes: 15),
|
||||||
final List<Duration> presetDurations = const [
|
final List<Duration> presetDurations = const [
|
||||||
Duration(minutes: 5),
|
Duration(minutes: 5),
|
||||||
|
Duration(minutes: 10),
|
||||||
Duration(minutes: 15),
|
Duration(minutes: 15),
|
||||||
|
Duration(minutes: 20),
|
||||||
Duration(minutes: 30)
|
Duration(minutes: 30)
|
||||||
],
|
],
|
||||||
this.maxDuration = const Duration(minutes: 100),
|
this.maxDuration = const Duration(minutes: 100),
|
||||||
|
|
|
||||||
|
|
@ -155,7 +155,9 @@ _$SleepTimerSettingsImpl _$$SleepTimerSettingsImplFromJson(
|
||||||
.toList() ??
|
.toList() ??
|
||||||
const [
|
const [
|
||||||
Duration(minutes: 5),
|
Duration(minutes: 5),
|
||||||
|
Duration(minutes: 10),
|
||||||
Duration(minutes: 15),
|
Duration(minutes: 15),
|
||||||
|
Duration(minutes: 20),
|
||||||
Duration(minutes: 30)
|
Duration(minutes: 30)
|
||||||
],
|
],
|
||||||
maxDuration: json['maxDuration'] == null
|
maxDuration: json['maxDuration'] == null
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue