|
|
|
|
@ -10,6 +10,7 @@ import 'package:mc_common_app/theme/colors.dart';
|
|
|
|
|
import 'package:mc_common_app/utils/enums.dart';
|
|
|
|
|
import 'package:mc_common_app/utils/navigator.dart';
|
|
|
|
|
import 'package:mc_common_app/view_models/dashboard_view_model_customer.dart';
|
|
|
|
|
import 'package:mc_common_app/view_models/user_view_model.dart';
|
|
|
|
|
import 'package:mc_common_app/views/setting_options/widgets/custom_setting_options_tile.dart';
|
|
|
|
|
import 'package:mc_common_app/widgets/button/show_fill_button.dart';
|
|
|
|
|
import 'package:mc_common_app/widgets/common_widgets/app_bar.dart';
|
|
|
|
|
@ -40,8 +41,7 @@ class SettingOptionsLanguage extends StatelessWidget {
|
|
|
|
|
Column(
|
|
|
|
|
children: [
|
|
|
|
|
CustomSettingOptionsTile(
|
|
|
|
|
leadingWidget:
|
|
|
|
|
const Icon(Icons.quickreply_outlined, size: 20),
|
|
|
|
|
leadingWidget: const Icon(Icons.quickreply_outlined, size: 20),
|
|
|
|
|
titleText: LocaleKeys.requests.tr(),
|
|
|
|
|
needBorderBelow: true,
|
|
|
|
|
onTap: () {
|
|
|
|
|
@ -56,12 +56,10 @@ class SettingOptionsLanguage extends StatelessWidget {
|
|
|
|
|
//navigateWithName(context, AppRoutes.settingOptionsInviteFriends),
|
|
|
|
|
),
|
|
|
|
|
CustomSettingOptionsTile(
|
|
|
|
|
leadingWidget:
|
|
|
|
|
const Icon(Icons.question_mark_outlined, size: 20),
|
|
|
|
|
leadingWidget: const Icon(Icons.question_mark_outlined, size: 20),
|
|
|
|
|
titleText: LocaleKeys.help.tr(),
|
|
|
|
|
needBorderBelow: true,
|
|
|
|
|
onTap: () =>
|
|
|
|
|
navigateWithName(context, AppRoutes.settingOptionsHelp),
|
|
|
|
|
onTap: () => navigateWithName(context, AppRoutes.settingOptionsHelp),
|
|
|
|
|
),
|
|
|
|
|
CustomSettingOptionsTile(
|
|
|
|
|
leadingWidget: const Icon(Icons.person, size: 20),
|
|
|
|
|
@ -73,29 +71,25 @@ class SettingOptionsLanguage extends StatelessWidget {
|
|
|
|
|
// Navigator.pop(context);
|
|
|
|
|
}),
|
|
|
|
|
],
|
|
|
|
|
).toWhiteContainer(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
pading: const EdgeInsets.all(12),
|
|
|
|
|
borderRadius: 0),
|
|
|
|
|
).toWhiteContainer(width: double.infinity, pading: const EdgeInsets.all(12), borderRadius: 0),
|
|
|
|
|
10.height,
|
|
|
|
|
CustomSettingOptionsTile(
|
|
|
|
|
leadingWidget: const Icon(Icons.translate, size: 20),
|
|
|
|
|
titleText: LocaleKeys.language.tr(),
|
|
|
|
|
isForLanguage: true,
|
|
|
|
|
onTap: () {
|
|
|
|
|
if (EasyLocalization.of(context)
|
|
|
|
|
?.currentLocale
|
|
|
|
|
?.countryCode ==
|
|
|
|
|
"SA") {
|
|
|
|
|
context.setLocale(const Locale("en", "US"));
|
|
|
|
|
} else {
|
|
|
|
|
context.setLocale(const Locale('ar', 'SA'));
|
|
|
|
|
}
|
|
|
|
|
// if (EasyLocalization.of(context)
|
|
|
|
|
// ?.currentLocale
|
|
|
|
|
// ?.countryCode ==
|
|
|
|
|
// "SA") {
|
|
|
|
|
// context.setLocale(const Locale("en", "US"));
|
|
|
|
|
// } else {
|
|
|
|
|
// context.setLocale(const Locale('ar', 'SA'));
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
context.read<UserVM>().changeLanguage(context);
|
|
|
|
|
},
|
|
|
|
|
).toWhiteContainer(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
pading: const EdgeInsets.all(12),
|
|
|
|
|
borderRadius: 0),
|
|
|
|
|
).toWhiteContainer(width: double.infinity, pading: const EdgeInsets.all(12), borderRadius: 0),
|
|
|
|
|
10.height,
|
|
|
|
|
(AppState().currentAppType == AppType.provider)
|
|
|
|
|
? Column(
|
|
|
|
|
@ -114,8 +108,7 @@ class SettingOptionsLanguage extends StatelessWidget {
|
|
|
|
|
isForLanguage: false,
|
|
|
|
|
needBorderBelow: true,
|
|
|
|
|
onTap: () {
|
|
|
|
|
navigateWithName(
|
|
|
|
|
context, AppRoutes.mySubscriptionsPage);
|
|
|
|
|
navigateWithName(context, AppRoutes.mySubscriptionsPage);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
CustomSettingOptionsTile(
|
|
|
|
|
@ -132,8 +125,7 @@ class SettingOptionsLanguage extends StatelessWidget {
|
|
|
|
|
isForLanguage: false,
|
|
|
|
|
needBorderBelow: true,
|
|
|
|
|
onTap: () {
|
|
|
|
|
navigateWithName(
|
|
|
|
|
context, AppRoutes.subscriptionsPage);
|
|
|
|
|
navigateWithName(context, AppRoutes.subscriptionsPage);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
CustomSettingOptionsTile(
|
|
|
|
|
@ -150,19 +142,13 @@ class SettingOptionsLanguage extends StatelessWidget {
|
|
|
|
|
isForLanguage: false,
|
|
|
|
|
needBorderBelow: false,
|
|
|
|
|
onTap: () {
|
|
|
|
|
navigateWithName(
|
|
|
|
|
context, AppRoutes.providerLicensePage);
|
|
|
|
|
navigateWithName(context, AppRoutes.providerLicensePage);
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
).toWhiteContainer(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
pading: const EdgeInsets.all(12),
|
|
|
|
|
borderRadius: 0)
|
|
|
|
|
: SizedBox(),
|
|
|
|
|
(AppState().currentAppType == AppType.provider)
|
|
|
|
|
? 10.height
|
|
|
|
|
).toWhiteContainer(width: double.infinity, pading: const EdgeInsets.all(12), borderRadius: 0)
|
|
|
|
|
: SizedBox(),
|
|
|
|
|
(AppState().currentAppType == AppType.provider) ? 10.height : SizedBox(),
|
|
|
|
|
],
|
|
|
|
|
)),
|
|
|
|
|
// : Expanded(
|
|
|
|
|
@ -188,9 +174,7 @@ class SettingOptionsLanguage extends StatelessWidget {
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
(AppState().currentAppType == AppType.provider)
|
|
|
|
|
? Text(LocaleKeys.provider.tr())
|
|
|
|
|
: Text(LocaleKeys.customer.tr()),
|
|
|
|
|
(AppState().currentAppType == AppType.provider) ? Text(LocaleKeys.provider.tr()) : Text(LocaleKeys.customer.tr()),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
@ -201,7 +185,9 @@ class SettingOptionsLanguage extends StatelessWidget {
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
maxHeight: 55,
|
|
|
|
|
title: LocaleKeys.logOut.tr(),
|
|
|
|
|
onPressed: () {},
|
|
|
|
|
onPressed: () {
|
|
|
|
|
context.read<UserVM>().logout(context);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
|