Add ideas and reminders CRUD flows with navigation
This commit is contained in:
@@ -2,8 +2,10 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:relationship_saver/core/config/app_theme.dart';
|
||||
import 'package:relationship_saver/features/dashboard/dashboard_view.dart';
|
||||
import 'package:relationship_saver/features/ideas/ideas_view.dart';
|
||||
import 'package:relationship_saver/features/moments/moments_view.dart';
|
||||
import 'package:relationship_saver/features/people/people_view.dart';
|
||||
import 'package:relationship_saver/features/reminders/reminders_view.dart';
|
||||
import 'package:relationship_saver/features/settings/settings_view.dart';
|
||||
import 'package:relationship_saver/features/signals/signals_view.dart';
|
||||
import 'package:relationship_saver/features/sync/sync_view.dart';
|
||||
@@ -23,8 +25,10 @@ class _AppShellState extends ConsumerState<AppShell> {
|
||||
_ShellDestination('People', Icons.people_alt_rounded, 1),
|
||||
_ShellDestination('Moments', Icons.auto_awesome_rounded, 2),
|
||||
_ShellDestination('Signals', Icons.tips_and_updates_rounded, 3),
|
||||
_ShellDestination('Sync', Icons.sync_rounded, 4),
|
||||
_ShellDestination('Settings', Icons.settings_rounded, 5),
|
||||
_ShellDestination('Ideas', Icons.lightbulb_outline_rounded, 4),
|
||||
_ShellDestination('Reminders', Icons.notifications_active_outlined, 5),
|
||||
_ShellDestination('Sync', Icons.sync_rounded, 6),
|
||||
_ShellDestination('Settings', Icons.settings_rounded, 7),
|
||||
];
|
||||
|
||||
static const List<_ShellDestination> _compactPrimaryDestinations =
|
||||
@@ -70,8 +74,10 @@ class _AppShellState extends ConsumerState<AppShell> {
|
||||
},
|
||||
onOpenSecondary: (_SecondaryDestination destination) {
|
||||
final int screenIndex = switch (destination) {
|
||||
_SecondaryDestination.sync => 4,
|
||||
_SecondaryDestination.settings => 5,
|
||||
_SecondaryDestination.ideas => 4,
|
||||
_SecondaryDestination.reminders => 5,
|
||||
_SecondaryDestination.sync => 6,
|
||||
_SecondaryDestination.settings => 7,
|
||||
};
|
||||
|
||||
Navigator.of(context).push<void>(
|
||||
@@ -137,8 +143,12 @@ class _AppShellState extends ConsumerState<AppShell> {
|
||||
case 3:
|
||||
return const SignalsView();
|
||||
case 4:
|
||||
return const SyncView();
|
||||
return const IdeasView();
|
||||
case 5:
|
||||
return const RemindersView();
|
||||
case 6:
|
||||
return const SyncView();
|
||||
case 7:
|
||||
return const SettingsView();
|
||||
default:
|
||||
return const DashboardView();
|
||||
@@ -298,6 +308,14 @@ class _CompactShell extends StatelessWidget {
|
||||
onSelected: onOpenSecondary,
|
||||
itemBuilder: (BuildContext context) =>
|
||||
<PopupMenuEntry<_SecondaryDestination>>[
|
||||
const PopupMenuItem<_SecondaryDestination>(
|
||||
value: _SecondaryDestination.ideas,
|
||||
child: Text('Ideas'),
|
||||
),
|
||||
const PopupMenuItem<_SecondaryDestination>(
|
||||
value: _SecondaryDestination.reminders,
|
||||
child: Text('Reminders'),
|
||||
),
|
||||
const PopupMenuItem<_SecondaryDestination>(
|
||||
value: _SecondaryDestination.sync,
|
||||
child: Text('Sync'),
|
||||
@@ -359,7 +377,7 @@ class _CompactSecondaryScreen extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
enum _SecondaryDestination { sync, settings }
|
||||
enum _SecondaryDestination { ideas, reminders, sync, settings }
|
||||
|
||||
class _ShellDestination {
|
||||
const _ShellDestination(this.label, this.icon, this.screenIndex);
|
||||
|
||||
Reference in New Issue
Block a user