Skip to content

Commit

Permalink
feat: add notification settings page and update routing
Browse files Browse the repository at this point in the history
  • Loading branch information
Dr-Blank committed Sep 25, 2024
1 parent e89cda8 commit c0c5cf6
Show file tree
Hide file tree
Showing 7 changed files with 818 additions and 332 deletions.
9 changes: 7 additions & 2 deletions lib/router/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,14 @@ class Routes {
name: 'settings',
);
static const autoSleepTimerSettings = _SimpleRoute(
pathName: 'autosleeptimer',
pathName: 'autoSleepTimer',
name: 'autoSleepTimerSettings',
// parentRoute: settings,
parentRoute: settings,
);
static const notificationSettings = _SimpleRoute(
pathName: 'notifications',
name: 'notificationSettings',
parentRoute: settings,
);

// search and explore
Expand Down
26 changes: 17 additions & 9 deletions lib/router/router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import 'package:vaani/features/you/view/you_page.dart';
import 'package:vaani/pages/home_page.dart';
import 'package:vaani/settings/view/app_settings_page.dart';
import 'package:vaani/settings/view/auto_sleep_timer_settings_page.dart';
import 'package:vaani/settings/view/notification_settings_page.dart';

import 'scaffold_with_nav_bar.dart';
import 'transitions/slide.dart';
Expand Down Expand Up @@ -172,15 +173,22 @@ class MyAppRouter {
name: Routes.settings.name,
// builder: (context, state) => const AppSettingsPage(),
pageBuilder: defaultPageBuilder(const AppSettingsPage()),
),
GoRoute(
path: Routes.autoSleepTimerSettings.localPath,
name: Routes.autoSleepTimerSettings.name,
// builder: (context, state) =>
// const AutoSleepTimerSettingsPage(),
pageBuilder: defaultPageBuilder(
const AutoSleepTimerSettingsPage(),
),
routes: [
GoRoute(
path: Routes.autoSleepTimerSettings.pathName,
name: Routes.autoSleepTimerSettings.name,
pageBuilder: defaultPageBuilder(
const AutoSleepTimerSettingsPage(),
),
),
GoRoute(
path: Routes.notificationSettings.pathName,
name: Routes.notificationSettings.name,
pageBuilder: defaultPageBuilder(
const NotificationSettingsPage(),
),
),
],
),
GoRoute(
path: Routes.userManagement.localPath,
Expand Down
17 changes: 11 additions & 6 deletions lib/settings/models/app_settings.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// a freezed class to store the settings of the app

import 'package:flutter/material.dart';
import 'package:freezed_annotation/freezed_annotation.dart';

part 'app_settings.freezed.dart';
Expand Down Expand Up @@ -173,10 +174,14 @@ enum NotificationTitleType {
}

enum NotificationMediaControl {
fastForward,
rewind,
speedToggle,
stop,
skipToNextChapter,
skipToPreviousChapter,
fastForward(Icons.fast_forward),
rewind(Icons.fast_rewind),
speedToggle(Icons.speed),
stop(Icons.stop),
skipToNextChapter(Icons.skip_next),
skipToPreviousChapter(Icons.skip_previous);

const NotificationMediaControl(this.icon);

final IconData icon;
}
Loading

0 comments on commit c0c5cf6

Please sign in to comment.