25-2/7/1
This commit is contained in:
@@ -4,6 +4,7 @@ import 'package:sefer_driver/constant/colors.dart';
|
||||
import 'package:sefer_driver/constant/style.dart';
|
||||
import 'package:sefer_driver/controller/home/payment/captain_wallet_controller.dart';
|
||||
import 'package:sefer_driver/controller/payment/payment_controller.dart';
|
||||
import 'package:sefer_driver/views/widgets/mydialoug.dart';
|
||||
|
||||
import '../../../constant/box_name.dart';
|
||||
import '../../../main.dart';
|
||||
@@ -105,6 +106,13 @@ class PointsCaptain extends StatelessWidget {
|
||||
.getCaptainWalletFromBuyPoints();
|
||||
});
|
||||
}
|
||||
MyDialog().getDialog(
|
||||
'phone number is wrong'.tr,
|
||||
'',
|
||||
() {
|
||||
Get.back();
|
||||
},
|
||||
);
|
||||
// Get.back();
|
||||
}));
|
||||
},
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:sefer_driver/views/home/Captin/home_captain/home_captin.dart';
|
||||
import 'package:sefer_driver/views/widgets/elevated_btn.dart';
|
||||
|
||||
import '../../controller/local/local_controller.dart';
|
||||
|
||||
class Language extends StatelessWidget {
|
||||
@@ -14,46 +15,55 @@ class Language extends StatelessWidget {
|
||||
middle: Text('Choose Language'.tr),
|
||||
border: null,
|
||||
),
|
||||
child: SafeArea(
|
||||
child: GetBuilder<LocaleController>(
|
||||
builder: (controller) => Center(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
children: [
|
||||
_buildHeader(),
|
||||
const SizedBox(height: 20),
|
||||
Expanded(
|
||||
child: ListView(
|
||||
physics: const BouncingScrollPhysics(),
|
||||
children: [
|
||||
_buildLanguageButton(
|
||||
'العربية', 'ar', controller, context),
|
||||
_buildLanguageButton(
|
||||
'English', 'en', controller, context),
|
||||
_buildLanguageButton(
|
||||
'Türkçe', 'tr', controller, context),
|
||||
_buildLanguageButton(
|
||||
'Français', 'fr', controller, context),
|
||||
_buildLanguageButton(
|
||||
'Italiano', 'it', controller, context),
|
||||
_buildLanguageButton(
|
||||
'Deutsch', 'de', controller, context),
|
||||
_buildLanguageButton(
|
||||
'Ελληνικά', 'el', controller, context),
|
||||
_buildLanguageButton(
|
||||
'Español', 'es', controller, context),
|
||||
_buildLanguageButton(
|
||||
'فارسی', 'fa', controller, context),
|
||||
_buildLanguageButton('中文', 'zh', controller, context),
|
||||
_buildLanguageButton(
|
||||
'Русский', 'ru', controller, context),
|
||||
_buildLanguageButton(
|
||||
'हिन्दी', 'hi', controller, context),
|
||||
],
|
||||
child: Material(
|
||||
// Wrap SafeArea with Material widget
|
||||
child: SafeArea(
|
||||
child: GetBuilder<LocaleController>(
|
||||
builder: (controller) => Center(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
_buildHeader(),
|
||||
const SizedBox(height: 20),
|
||||
Expanded(
|
||||
child: ListView(
|
||||
physics: const BouncingScrollPhysics(),
|
||||
children: [
|
||||
_buildLanguageButton(
|
||||
'العربية', 'ar', controller, context, '🇪🇬'),
|
||||
_buildLanguageButton('العربية (الخليج)', 'ar-gulf',
|
||||
controller, context, '🇸🇦'),
|
||||
_buildLanguageButton('العربية (المغرب)', 'ar-ma',
|
||||
controller, context, '🇲🇦'),
|
||||
_buildLanguageButton(
|
||||
'English', 'en', controller, context, '🇺🇸'),
|
||||
_buildLanguageButton(
|
||||
'Türkçe', 'tr', controller, context, '🇹🇷'),
|
||||
_buildLanguageButton(
|
||||
'Français', 'fr', controller, context, '🇫🇷'),
|
||||
_buildLanguageButton(
|
||||
'Italiano', 'it', controller, context, '🇮🇹'),
|
||||
_buildLanguageButton(
|
||||
'Deutsch', 'de', controller, context, '🇩🇪'),
|
||||
_buildLanguageButton(
|
||||
'Ελληνικά', 'el', controller, context, '🇬🇷'),
|
||||
_buildLanguageButton(
|
||||
'Español', 'es', controller, context, '🇪🇸'),
|
||||
_buildLanguageButton(
|
||||
'فارسی', 'fa', controller, context, '🇮🇷'),
|
||||
_buildLanguageButton(
|
||||
'中文', 'zh', controller, context, '🇨🇳'),
|
||||
_buildLanguageButton(
|
||||
'Русский', 'ru', controller, context, '🇷🇺'),
|
||||
_buildLanguageButton(
|
||||
'हिन्दी', 'hi', controller, context, '🇮🇳'),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -63,39 +73,28 @@ class Language extends StatelessWidget {
|
||||
}
|
||||
|
||||
Widget _buildHeader() {
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(20),
|
||||
decoration: BoxDecoration(
|
||||
gradient: const LinearGradient(
|
||||
colors: [Color(0xFF2196F3), Color(0xFF1976D2)],
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: CupertinoColors.systemBlue.withOpacity(0.2),
|
||||
blurRadius: 10,
|
||||
offset: const Offset(0, 4),
|
||||
),
|
||||
],
|
||||
),
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(top: 20, bottom: 10),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const Icon(
|
||||
CupertinoIcons.globe,
|
||||
color: CupertinoColors.white,
|
||||
size: 48,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
Text(
|
||||
'Choose Language'.tr,
|
||||
'Language Options'.tr,
|
||||
style: const TextStyle(
|
||||
color: CupertinoColors.white,
|
||||
fontSize: 22,
|
||||
fontSize: 24,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: CupertinoColors.black, // Or your theme primary color
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
textAlign: TextAlign.start,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
'Select your preferred language for the app interface.',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: CupertinoColors.secondaryLabel,
|
||||
),
|
||||
textAlign: TextAlign.start,
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -103,28 +102,49 @@ class Language extends StatelessWidget {
|
||||
}
|
||||
|
||||
Widget _buildLanguageButton(String title, String langCode,
|
||||
LocaleController controller, BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 8),
|
||||
child: MyElevatedButton(
|
||||
title: title,
|
||||
onPressed: () async {
|
||||
controller.changeLang(langCode);
|
||||
showCupertinoDialog(
|
||||
context: context,
|
||||
builder: (context) => CupertinoAlertDialog(
|
||||
title: Text('You should restart app to change language'.tr),
|
||||
actions: [
|
||||
CupertinoDialogAction(
|
||||
child: Text('Ok'.tr),
|
||||
onPressed: () {
|
||||
Get.offAll(() => HomeCaptain());
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
));
|
||||
LocaleController controller, BuildContext context, String flagIcon) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: CupertinoColors.white,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: CupertinoColors.systemGrey5.withOpacity(0.5),
|
||||
spreadRadius: 1,
|
||||
blurRadius: 3,
|
||||
offset: const Offset(0, 2),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: ListTile(
|
||||
leading: Text(flagIcon,
|
||||
style: const TextStyle(fontSize: 28)), // Using flag icon as leading
|
||||
title: Text(
|
||||
title,
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
trailing: const Icon(CupertinoIcons.chevron_forward,
|
||||
color: CupertinoColors.inactiveGray),
|
||||
onTap: () async {
|
||||
controller.changeLang(langCode);
|
||||
showCupertinoDialog(
|
||||
context: context,
|
||||
builder: (context) => CupertinoAlertDialog(
|
||||
title: Text('You should restart app to change language'.tr),
|
||||
actions: [
|
||||
CupertinoDialogAction(
|
||||
child: Text('Ok'.tr),
|
||||
onPressed: () {
|
||||
Get.offAll(() => HomeCaptain());
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user