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, _) {
return CircleAvatar(
radius: 45,
backgroundColor: context.isDark ? AppColor.neutral50 : AppColor.neutral40,
backgroundColor: AppColor.scaffoldBackground(context),
child: Padding(
padding: const EdgeInsets.all(1), // Border radius
child: ClipOval(
@ -47,7 +47,7 @@ class AppDrawer extends StatelessWidget {
? Image.file(snapshot.profileImage!)
: (snapshot.user?.profilePhotoName?.isNotEmpty ?? false)
? 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,
(userProvider.user?.username ?? "").heading3(context).custom(fontWeight: FontWeight.w600),
if ((userProvider.user?.email ?? "").isNotEmpty) (userProvider.user!.email!).heading6(context).custom(color: context.isDark ? AppColor.neutral10 : AppColor.neutral20),
18.height,
(userProvider.user?.username ?? "").heading4(context).custom(color: AppColor.labelTextStyleColor(context)),
if ((userProvider.user?.email ?? "").isNotEmpty) (userProvider.user!.email!).heading6(context).custom(color: AppColor.lightTextColor(context)),
16.height,
const Divider().defaultStyle(context),
ListView(
padding: const EdgeInsets.only(top: 24),
@ -79,7 +79,7 @@ class AppDrawer extends StatelessWidget {
// drawerItem("whats_new", context.translation.whatsNew, context),
],
).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(
context: context,
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}) {
return Row(
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,
Text(
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/widget_extensions.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';
@ -105,7 +106,7 @@ class _SettingsPageState extends State<SettingsPage> {
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
context.translation.arabic.heading5(context).custom(color: AppColor.textStyleColor(context)),
InfoHeader16Widget(context.translation.arabic),
AdvancedSwitch(
controller: langController,
initialValue: langController!.value,
@ -128,7 +129,7 @@ class _SettingsPageState extends State<SettingsPage> {
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
context.translation.lightTheme.heading5(context).custom(color: AppColor.textStyleColor(context)),
InfoHeader16Widget(context.translation.lightTheme),
AdvancedSwitch(
controller: themeController,
initialValue: themeController!.value,
@ -154,13 +155,13 @@ class _SettingsPageState extends State<SettingsPage> {
}
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(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
"Fingerprint/Face ID".heading5(context).custom(color: AppColor.textStyleColor(context)),
InfoHeader16Widget("Fingerprint/Face ID"),
customSwitch(localAuth).onPress(() {
checkForLocalAuth(localAuth);
}),

Loading…
Cancel
Save