kirakira/lib/presentation/widgets/drawer/app_drawer.dart

36 lines
1.2 KiB
Dart
Raw Normal View History

2024-02-17 20:32:01 +05:30
import "package:flutter_riverpod/flutter_riverpod.dart";
import "package:flutter/material.dart";
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) {
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(
backgroundColor: Theme.of(context).extension<AppColors>()!.cardFill,
2024-02-17 20:32:01 +05:30
child: Padding(
padding: const EdgeInsets.only(top: 60),
2024-02-17 20:32:01 +05:30
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
IdentityHeader(address: address, fingerprint: fp),
2024-02-17 20:32:01 +05:30
const SizedBox(height: 50),
const DrawerList(),
],
),
),
);
}
}