app drawer and setting page

main_production_RSG
Sikander Saleem 2 months ago
parent d45c6a1db8
commit 3bd4fa6801

@ -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)),
), ),
], ],
); );

@ -12,6 +12,7 @@ import 'package:test_sa/extensions/int_extensions.dart';
import 'package:test_sa/extensions/text_extensions.dart'; import 'package:test_sa/extensions/text_extensions.dart';
import 'package:test_sa/extensions/widget_extensions.dart'; import 'package:test_sa/extensions/widget_extensions.dart';
import 'package:test_sa/new_views/app_style/app_color.dart'; import 'package:test_sa/new_views/app_style/app_color.dart';
import 'package:test_sa/views/widgets/item_views/info_header_widget.dart';
import '../common_widgets/default_app_bar.dart'; import '../common_widgets/default_app_bar.dart';
@ -105,7 +106,7 @@ class _SettingsPageState extends State<SettingsPage> {
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
context.translation.arabic.heading5(context).custom(color: AppColor.textStyleColor(context)), InfoHeader16Widget(context.translation.arabic),
AdvancedSwitch( AdvancedSwitch(
controller: langController, controller: langController,
initialValue: langController!.value, initialValue: langController!.value,
@ -128,7 +129,7 @@ class _SettingsPageState extends State<SettingsPage> {
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
context.translation.lightTheme.heading5(context).custom(color: AppColor.textStyleColor(context)), InfoHeader16Widget(context.translation.lightTheme),
AdvancedSwitch( AdvancedSwitch(
controller: themeController, controller: themeController,
initialValue: themeController!.value, initialValue: themeController!.value,
@ -154,13 +155,13 @@ class _SettingsPageState extends State<SettingsPage> {
} }
if (!isDeviceSupported) { if (!isDeviceSupported) {
return Text("Your device did not support Fingerprint/Face ID.", style: AppTextStyles.tinyFont.copyWith(fontSize: 11, color: Colors.red)); return Text("Your device did not support Fingerprint/Face ID.", style: AppTextStyles.tinyFont.copyWith(color: AppColor.red30));
} }
return Row( return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
"Fingerprint/Face ID".heading5(context).custom(color: AppColor.textStyleColor(context)), InfoHeader16Widget("Fingerprint/Face ID"),
customSwitch(localAuth).onPress(() { customSwitch(localAuth).onPress(() {
checkForLocalAuth(localAuth); checkForLocalAuth(localAuth);
}), }),

Loading…
Cancel
Save