25-7-28-2
This commit is contained in:
157
lib/views/home/Captin/About Us/settings_captain.dart
Executable file
157
lib/views/home/Captin/About Us/settings_captain.dart
Executable file
@@ -0,0 +1,157 @@
|
||||
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:get/get.dart';
|
||||
import 'package:sefer_driver/constant/style.dart';
|
||||
import 'package:sefer_driver/views/lang/languages.dart';
|
||||
import 'package:sefer_driver/views/widgets/my_scafold.dart';
|
||||
|
||||
import '../../../../controller/functions/vibrate.dart';
|
||||
import '../../../auth/country_widget.dart';
|
||||
import 'about_us.dart';
|
||||
import 'frequantly_question.dart';
|
||||
import 'using_app_page.dart';
|
||||
|
||||
class SettingsCaptain extends StatelessWidget {
|
||||
const SettingsCaptain({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Get.put(SettingController());
|
||||
Get.put(HomePageController());
|
||||
return MyScafolld(
|
||||
title: 'Settings'.tr,
|
||||
body: [
|
||||
ListView(
|
||||
physics: const BouncingScrollPhysics(),
|
||||
children: <Widget>[
|
||||
// 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
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
// 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'),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
// 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 Intaleq".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()),
|
||||
),
|
||||
],
|
||||
),
|
||||
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