import 'package:SEFER/constant/colors.dart';
import 'package:SEFER/controller/profile/setting_controller.dart';
import 'package:SEFER/views/home/profile/passenger_profile_page.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/constant/style.dart';
import 'package:SEFER/views/lang/languages.dart';
import 'package:SEFER/views/widgets/my_scafold.dart';

class SettingsCaptain extends StatelessWidget {
  const SettingsCaptain({super.key});

  @override
  Widget build(BuildContext context) {
    Get.put(SettingController());
    return MyScafolld(
      title: 'Settings'.tr,
      body: [
        ListView(
          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,
                  onChanged: (bool value) {
                    settingController.onChangMapApp();
                  },
                );
              }),
            ),
            const Divider(
              endIndent: 44,
              indent: 44,
            ),
            // ListTile(
            //   leading: const Icon(Icons.account_circle),
            //   title: const Text('Account'),
            //   onTap: () => Navigator.pushNamed(context, '/account-settings'),
            // ),
          ],
        ),
      ],
      isleading: true,
    );
  }
}
