feat: replace mail protocol with smolmail and rebuild the UI
This commit is contained in:
parent
cb24b68069
commit
e94e4158cc
93 changed files with 6387 additions and 3479 deletions
|
|
@ -1,24 +1,19 @@
|
|||
import "package:flutter/material.dart";
|
||||
import "package:flutter_riverpod/flutter_riverpod.dart";
|
||||
import "package:auto_route/auto_route.dart";
|
||||
|
||||
import "package:flash_mail/data/providers/providers.dart";
|
||||
import "package:flash_mail/shared/configs/flash_mail_icons.dart";
|
||||
import "package:flash_mail/presentation/widgets/drawer/drawer_list_tile.dart";
|
||||
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";
|
||||
|
||||
class DrawerList extends ConsumerWidget {
|
||||
const DrawerList({super.key});
|
||||
|
||||
Future<void> signOut(BuildContext context, WidgetRef ref) async {
|
||||
Navigator.of(context).pop();
|
||||
await ref.read(accountProvider.notifier).logout();
|
||||
if (context.mounted) {
|
||||
AutoRouter.of(context).replaceNamed("/");
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final unread = ref.watch(unreadProvider);
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(left: 25),
|
||||
child: Column(
|
||||
|
|
@ -26,16 +21,40 @@ class DrawerList extends ConsumerWidget {
|
|||
DrawerListTile(
|
||||
color: Theme.of(context).primaryColor,
|
||||
icon: FlashMailIcons.inbox,
|
||||
title: "Inbox",
|
||||
onTap: () => Navigator.of(context).pop(),
|
||||
title: "Inbox${unread > 0 ? " ($unread)" : ""}",
|
||||
onTap: () {
|
||||
ref.read(folderProvider.notifier).select("inbox");
|
||||
ref.read(revisionProvider.notifier).bump();
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
Consumer(
|
||||
builder: (context, ref, _) => DrawerListTile(
|
||||
color: Theme.of(context).colorScheme.error,
|
||||
icon: FlashMailIcons.sign_out,
|
||||
title: "Sign out",
|
||||
onTap: () => signOut(context, ref),
|
||||
),
|
||||
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());
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue