2024-02-17 20:32:01 +05:30
|
|
|
import "package:flutter_riverpod/flutter_riverpod.dart";
|
|
|
|
|
import "package:flutter/material.dart";
|
|
|
|
|
|
2026-09-26 22:45:38 +03:00
|
|
|
import "package:smol_mail/data/providers/providers.dart";
|
|
|
|
|
import "package:smol_mail/smol/proto.dart";
|
|
|
|
|
import "package:smol_mail/presentation/widgets/drawer/identity_header.dart";
|
|
|
|
|
import "package:smol_mail/presentation/widgets/drawer/drawer_list.dart";
|
|
|
|
|
import "package:smol_mail/presentation/theme/app_colors.dart";
|
2024-02-17 20:32:01 +05:30
|
|
|
|
|
|
|
|
class AppDrawer extends ConsumerWidget {
|
|
|
|
|
const AppDrawer({super.key});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context, WidgetRef ref) {
|
2026-09-26 22:45:38 +03:00
|
|
|
final identity = ref.watch(identityProvider);
|
|
|
|
|
final account = ref.watch(accountProvider);
|
|
|
|
|
final address = account?.short ?? "";
|
|
|
|
|
final fp = identity == null ? "" : fingerprint(identity.publicKey);
|
2024-02-17 20:32:01 +05:30
|
|
|
|
|
|
|
|
return Drawer(
|
2026-09-26 22:45:38 +03:00
|
|
|
backgroundColor: Theme.of(context).extension<AppColors>()!.cardFill,
|
2024-02-17 20:32:01 +05:30
|
|
|
child: Padding(
|
2026-09-26 22:45:38 +03:00
|
|
|
padding: const EdgeInsets.only(top: 60),
|
2024-02-17 20:32:01 +05:30
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
children: <Widget>[
|
2026-09-26 22:45:38 +03:00
|
|
|
IdentityHeader(address: address, fingerprint: fp),
|
2024-02-17 20:32:01 +05:30
|
|
|
const SizedBox(height: 50),
|
|
|
|
|
const DrawerList(),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|