2024-02-17 20:32:01 +05:30
|
|
|
import "package:flutter/material.dart";
|
|
|
|
|
import "package:flutter_riverpod/flutter_riverpod.dart";
|
|
|
|
|
|
2026-09-26 22:45:38 +03:00
|
|
|
import "package:smol_mail/data/providers/providers.dart";
|
|
|
|
|
import "package:smol_mail/presentation/routes/app_router.gr.dart";
|
|
|
|
|
import "package:auto_route/auto_route.dart";
|
|
|
|
|
import "package:smol_mail/shared/configs/flash_mail_icons.dart";
|
|
|
|
|
import "package:smol_mail/presentation/widgets/drawer/drawer_list_tile.dart";
|
2024-02-17 20:32:01 +05:30
|
|
|
|
|
|
|
|
class DrawerList extends ConsumerWidget {
|
|
|
|
|
const DrawerList({super.key});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context, WidgetRef ref) {
|
2026-09-26 22:45:38 +03:00
|
|
|
final unread = ref.watch(unreadProvider);
|
|
|
|
|
|
2024-02-17 20:32:01 +05:30
|
|
|
return Padding(
|
|
|
|
|
padding: const EdgeInsets.only(left: 25),
|
|
|
|
|
child: Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
DrawerListTile(
|
|
|
|
|
color: Theme.of(context).primaryColor,
|
|
|
|
|
icon: FlashMailIcons.inbox,
|
2026-09-26 22:45:38 +03:00
|
|
|
title: "Inbox${unread > 0 ? " ($unread)" : ""}",
|
|
|
|
|
onTap: () {
|
|
|
|
|
ref.read(folderProvider.notifier).select("inbox");
|
|
|
|
|
ref.read(revisionProvider.notifier).bump();
|
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
|
},
|
2024-02-17 20:32:01 +05:30
|
|
|
),
|
2026-09-26 22:45:38 +03:00
|
|
|
DrawerListTile(
|
|
|
|
|
color: Theme.of(context).primaryColor,
|
|
|
|
|
icon: Icons.outgoing_mail,
|
|
|
|
|
title: "Sent",
|
|
|
|
|
onTap: () {
|
|
|
|
|
ref.read(folderProvider.notifier).select("sent");
|
|
|
|
|
ref.read(revisionProvider.notifier).bump();
|
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
DrawerListTile(
|
|
|
|
|
color: Theme.of(context).primaryColor,
|
|
|
|
|
icon: Icons.contacts,
|
|
|
|
|
title: "Contacts",
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
|
AutoRouter.of(context).push(ContactsRoute());
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
DrawerListTile(
|
|
|
|
|
color: Theme.of(context).primaryColor,
|
|
|
|
|
icon: Icons.settings,
|
|
|
|
|
title: "Settings",
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
|
AutoRouter.of(context).push(SettingsRoute());
|
|
|
|
|
},
|
2024-02-17 20:32:01 +05:30
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|