|
|
|
@ -39,7 +39,7 @@ class AppDrawer extends StatelessWidget {
|
|
|
|
Consumer<UserProvider>(builder: (context, snapshot, _) {
|
|
|
|
Consumer<UserProvider>(builder: (context, snapshot, _) {
|
|
|
|
return CircleAvatar(
|
|
|
|
return CircleAvatar(
|
|
|
|
radius: 45,
|
|
|
|
radius: 45,
|
|
|
|
backgroundColor: context.isDark ? AppColor.neutral50 : AppColor.neutral40,
|
|
|
|
backgroundColor: AppColor.scaffoldBackground(context),
|
|
|
|
child: Padding(
|
|
|
|
child: Padding(
|
|
|
|
padding: const EdgeInsets.all(1), // Border radius
|
|
|
|
padding: const EdgeInsets.all(1), // Border radius
|
|
|
|
child: ClipOval(
|
|
|
|
child: ClipOval(
|
|
|
|
@ -47,7 +47,7 @@ class AppDrawer extends StatelessWidget {
|
|
|
|
? Image.file(snapshot.profileImage!)
|
|
|
|
? Image.file(snapshot.profileImage!)
|
|
|
|
: (snapshot.user?.profilePhotoName?.isNotEmpty ?? false)
|
|
|
|
: (snapshot.user?.profilePhotoName?.isNotEmpty ?? false)
|
|
|
|
? Image.network(snapshot.user!.profilePhotoName!)
|
|
|
|
? Image.network(snapshot.user!.profilePhotoName!)
|
|
|
|
: const Icon(Icons.person, size: 50, color: Colors.white),
|
|
|
|
: Icon(Icons.person, size: 50, color: AppColor.icon2Color(context)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
@ -56,9 +56,9 @@ class AppDrawer extends StatelessWidget {
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
8.height,
|
|
|
|
8.height,
|
|
|
|
(userProvider.user?.username ?? "").heading3(context).custom(fontWeight: FontWeight.w600),
|
|
|
|
(userProvider.user?.username ?? "").heading4(context).custom(color: AppColor.labelTextStyleColor(context)),
|
|
|
|
if ((userProvider.user?.email ?? "").isNotEmpty) (userProvider.user!.email!).heading6(context).custom(color: context.isDark ? AppColor.neutral10 : AppColor.neutral20),
|
|
|
|
if ((userProvider.user?.email ?? "").isNotEmpty) (userProvider.user!.email!).heading6(context).custom(color: AppColor.lightTextColor(context)),
|
|
|
|
18.height,
|
|
|
|
16.height,
|
|
|
|
const Divider().defaultStyle(context),
|
|
|
|
const Divider().defaultStyle(context),
|
|
|
|
ListView(
|
|
|
|
ListView(
|
|
|
|
padding: const EdgeInsets.only(top: 24),
|
|
|
|
padding: const EdgeInsets.only(top: 24),
|
|
|
|
@ -79,7 +79,7 @@ class AppDrawer extends StatelessWidget {
|
|
|
|
// drawerItem("whats_new", context.translation.whatsNew, context),
|
|
|
|
// drawerItem("whats_new", context.translation.whatsNew, context),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
).expanded,
|
|
|
|
).expanded,
|
|
|
|
drawerItem("logout", context.translation.logout, context, color: context.isDark ? AppColor.redStatus(context) : AppColor.red50).onPress(() async {
|
|
|
|
drawerItem("logout", context.translation.logout, context, color: AppColor.red30).onPress(() async {
|
|
|
|
bool result = await showDialog(
|
|
|
|
bool result = await showDialog(
|
|
|
|
context: context,
|
|
|
|
context: context,
|
|
|
|
builder: (_) => AAlertDialog(title: context.translation.signOut, content: context.translation.logoutAlert),
|
|
|
|
builder: (_) => AAlertDialog(title: context.translation.signOut, content: context.translation.logoutAlert),
|
|
|
|
@ -119,11 +119,11 @@ class AppDrawer extends StatelessWidget {
|
|
|
|
Widget drawerItem(String icon, String title, BuildContext context, {Color? color}) {
|
|
|
|
Widget drawerItem(String icon, String title, BuildContext context, {Color? color}) {
|
|
|
|
return Row(
|
|
|
|
return Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
(icon ?? "").toSvgAsset(width: 24, height: 24, color: color ?? (context.isDark ? AppColor.neutral10 : AppColor.neutral20)),
|
|
|
|
(icon ?? "").toSvgAsset(width: 24, height: 24, color: color ?? AppColor.icon2Color(context)),
|
|
|
|
16.width,
|
|
|
|
16.width,
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
title,
|
|
|
|
title,
|
|
|
|
style: AppTextStyles.heading6.copyWith(color: color ?? (context.isDark ? AppColor.neutral30 : AppColor.neutral50)),
|
|
|
|
style: AppTextStyles.heading6.copyWith(color: color ?? AppColor.labelTextStyleColor(context)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|