12/22/2
This commit is contained in:
@@ -2,7 +2,6 @@ import 'package:sefer_driver/constant/colors.dart';
|
||||
import 'package:sefer_driver/controller/profile/setting_controller.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_font_icons/flutter_font_icons.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:sefer_driver/constant/style.dart';
|
||||
import 'package:sefer_driver/views/lang/languages.dart';
|
||||
@@ -25,140 +24,134 @@ class SettingsCaptain extends StatelessWidget {
|
||||
title: 'Settings'.tr,
|
||||
body: [
|
||||
ListView(
|
||||
physics: const BouncingScrollPhysics(),
|
||||
children: <Widget>[
|
||||
ListTile(
|
||||
leading: const Icon(Icons.language),
|
||||
title: Text(
|
||||
'Language'.tr,
|
||||
style: AppStyle.headTitle2,
|
||||
),
|
||||
subtitle: Text('You can change the language of the app'.tr),
|
||||
onTap: () => Get.to(const Language()),
|
||||
),
|
||||
const Divider(
|
||||
endIndent: 44,
|
||||
indent: 44,
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.place_outlined),
|
||||
title: Text(
|
||||
'Change Country'.tr,
|
||||
style: AppStyle.headTitle2,
|
||||
),
|
||||
subtitle:
|
||||
Text('You can change the Country to get all features'.tr),
|
||||
onTap: () => Get.to(MyScafolld(
|
||||
title: 'Change Country'.tr,
|
||||
body: [CountryPickerFromSetting()],
|
||||
isleading: true)),
|
||||
),
|
||||
const Divider(
|
||||
endIndent: 44,
|
||||
indent: 44,
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(
|
||||
MaterialCommunityIcons.map_marker_radius,
|
||||
color: AppColor.redColor,
|
||||
),
|
||||
title: Text(
|
||||
'Google Map App'.tr,
|
||||
style: AppStyle.headTitle2,
|
||||
),
|
||||
subtitle: Text(
|
||||
'If you want to make Google Map App run directly when you apply order'
|
||||
.tr),
|
||||
trailing:
|
||||
GetBuilder<SettingController>(builder: (settingController) {
|
||||
return CupertinoSwitch(
|
||||
value: settingController.isGoogleMapsEnabled,
|
||||
activeColor: AppColor.primaryColor,
|
||||
onChanged: (bool value) {
|
||||
settingController.onChangMapApp();
|
||||
},
|
||||
);
|
||||
}),
|
||||
),
|
||||
const Divider(
|
||||
endIndent: 44,
|
||||
indent: 44,
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.question_answer),
|
||||
title: Text(
|
||||
'Frequently Questions'.tr,
|
||||
style: AppStyle.headTitle2,
|
||||
),
|
||||
subtitle: Text(
|
||||
'You can change the Country to get all features'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
onTap: () => Get.to(() => const FrequentlyQuestionsPage()),
|
||||
),
|
||||
const Divider(
|
||||
endIndent: 44,
|
||||
indent: 44,
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.vibration),
|
||||
title: Text(
|
||||
'Vibration'.tr,
|
||||
style: AppStyle.headTitle2,
|
||||
),
|
||||
subtitle: Text(
|
||||
"You can change the vibration feedback for all buttons".tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
trailing: GetBuilder<HomePageController>(
|
||||
builder: (controller) => CupertinoSwitch(
|
||||
value: controller.isVibrate,
|
||||
onChanged: controller.changeVibrateOption,
|
||||
activeColor: AppColor.primaryColor,
|
||||
)),
|
||||
onTap: () => print('3'),
|
||||
),
|
||||
const Divider(
|
||||
endIndent: 44,
|
||||
indent: 44,
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.help_outline),
|
||||
title: Text(
|
||||
"How to use SEFER".tr,
|
||||
style: AppStyle.headTitle2,
|
||||
),
|
||||
subtitle: Text(
|
||||
''.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
onTap: () => Get.to(() => const UsingAppPage()),
|
||||
// General Section
|
||||
_buildSectionHeader('General'.tr),
|
||||
CupertinoListSection(
|
||||
margin: EdgeInsets.zero,
|
||||
children: [
|
||||
CupertinoListTile(
|
||||
leading: const Icon(CupertinoIcons.globe),
|
||||
title: Text('Language'.tr, style: AppStyle.headTitle2),
|
||||
subtitle: Text('You can change the language of the app'.tr,
|
||||
style: AppStyle.subtitle),
|
||||
trailing: const CupertinoListTileChevron(),
|
||||
onTap: () => Get.to(const Language()),
|
||||
),
|
||||
CupertinoListTile(
|
||||
leading: const Icon(CupertinoIcons.flag_fill),
|
||||
title: Text('Change Country'.tr, style: AppStyle.headTitle2),
|
||||
subtitle: Text(
|
||||
'You can change the Country to get all features'.tr,
|
||||
style: AppStyle.subtitle),
|
||||
trailing: const CupertinoListTileChevron(),
|
||||
onTap: () => Get.to(
|
||||
MyScafolld(
|
||||
title: 'Change Country'.tr,
|
||||
body: [CountryPickerFromSetting()],
|
||||
isleading: true,
|
||||
// isCupertino: true, // Indicate it's a Cupertino style page
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
const Divider(
|
||||
endIndent: 44,
|
||||
indent: 44,
|
||||
// App Preferences Section
|
||||
_buildSectionHeader('App Preferences'.tr),
|
||||
CupertinoListSection(
|
||||
margin: EdgeInsets.zero,
|
||||
children: [
|
||||
CupertinoListTile(
|
||||
leading: Icon(
|
||||
CupertinoIcons.map_pin_ellipse,
|
||||
color: AppColor.redColor,
|
||||
),
|
||||
title: Text('Google Map App'.tr, style: AppStyle.headTitle2),
|
||||
subtitle: Text(
|
||||
'If you want to make Google Map App run directly when you apply order'
|
||||
.tr,
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
trailing: GetBuilder<SettingController>(
|
||||
builder: (settingController) {
|
||||
return CupertinoSwitch(
|
||||
value: settingController.isGoogleMapsEnabled,
|
||||
activeTrackColor: AppColor.primaryColor,
|
||||
onChanged: (bool value) {
|
||||
settingController.onChangMapApp();
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
CupertinoListTile(
|
||||
leading: Icon(Icons.vibration),
|
||||
title: Text('Vibration'.tr, style: AppStyle.headTitle2),
|
||||
subtitle: Text(
|
||||
"You can change the vibration feedback for all buttons".tr,
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
trailing: GetBuilder<HomePageController>(
|
||||
builder: (controller) => CupertinoSwitch(
|
||||
value: controller.isVibrate,
|
||||
onChanged: controller.changeVibrateOption,
|
||||
activeTrackColor: AppColor.primaryColor,
|
||||
),
|
||||
),
|
||||
onTap: () => print('3'),
|
||||
),
|
||||
],
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.account_balance_outlined),
|
||||
title: Text(
|
||||
'About Us'.tr,
|
||||
style: AppStyle.headTitle2,
|
||||
),
|
||||
subtitle: Text(
|
||||
'You can change the Country to get all features'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
onTap: () => Get.to(() => const AboutPage()),
|
||||
|
||||
// Help & Support Section
|
||||
_buildSectionHeader('Help & Support'.tr),
|
||||
CupertinoListSection(
|
||||
margin: EdgeInsets.zero,
|
||||
children: [
|
||||
CupertinoListTile(
|
||||
leading: const Icon(CupertinoIcons.question_circle_fill),
|
||||
title: Text('Frequently Questions'.tr,
|
||||
style: AppStyle.headTitle2),
|
||||
trailing: const CupertinoListTileChevron(),
|
||||
onTap: () => Get.to(() => const FrequentlyQuestionsPage()),
|
||||
),
|
||||
CupertinoListTile(
|
||||
leading: const Icon(CupertinoIcons.hand_raised_fill),
|
||||
title:
|
||||
Text("How to use SEFER".tr, style: AppStyle.headTitle2),
|
||||
trailing: const CupertinoListTileChevron(),
|
||||
onTap: () => Get.to(() => const UsingAppPage()),
|
||||
),
|
||||
CupertinoListTile(
|
||||
leading: const Icon(CupertinoIcons.info_circle_fill),
|
||||
title: Text('About Us'.tr, style: AppStyle.headTitle2),
|
||||
trailing: const CupertinoListTileChevron(),
|
||||
onTap: () => Get.to(() => const AboutPage()),
|
||||
),
|
||||
],
|
||||
),
|
||||
// ListTile(
|
||||
// leading: const Icon(Icons.account_circle),
|
||||
// title: const Text('Account'),
|
||||
// onTap: () => Navigator.pushNamed(context, '/account-settings'),
|
||||
// ),
|
||||
const SizedBox(height: 16),
|
||||
],
|
||||
),
|
||||
],
|
||||
isleading: true,
|
||||
// isCupertino: true, // Indicate this screen is generally Cupertino style
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildSectionHeader(String title) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(left: 16.0, top: 20.0, bottom: 10.0),
|
||||
child: Text(
|
||||
title,
|
||||
style: const TextStyle(
|
||||
fontSize: 17.0,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: CupertinoColors.secondaryLabel,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user