fix marker rendering & modernize riding widgets for dark mode - 2026-04-11
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
import 'package:Intaleq/controller/home/home_page_controller.dart';
|
||||
import 'package:Intaleq/controller/local/local_controller.dart';
|
||||
import 'package:Intaleq/constant/colors.dart';
|
||||
import 'package:Intaleq/constant/style.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:Intaleq/views/lang/languages.dart';
|
||||
@@ -32,16 +35,14 @@ class SettingPage extends StatelessWidget {
|
||||
Get.lazyPut(() => HomePageController());
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor:
|
||||
const Color(0xFFF5F5F7), // A slightly off-white background
|
||||
backgroundColor: AppColor.secondaryColor.withOpacity(0.94),
|
||||
appBar: AppBar(
|
||||
title: Text('Setting'.tr,
|
||||
style: const TextStyle(
|
||||
color: Colors.black87, fontWeight: FontWeight.bold)),
|
||||
backgroundColor: Colors.white,
|
||||
style: AppStyle.headTitle2.copyWith(fontSize: 20)),
|
||||
backgroundColor: AppColor.secondaryColor,
|
||||
elevation: 0.5,
|
||||
leading: IconButton(
|
||||
icon: const Icon(Icons.arrow_back_ios_new, color: Colors.black87),
|
||||
icon: Icon(Icons.arrow_back_ios_new, color: AppColor.writeColor),
|
||||
onPressed: () => Get.back(),
|
||||
),
|
||||
),
|
||||
@@ -59,14 +60,27 @@ class SettingPage extends StatelessWidget {
|
||||
subtitle: 'To change Language the App'.tr,
|
||||
onTap: () => Get.to(() => const Language()),
|
||||
),
|
||||
// const Divider(height: 1, indent: 68, endIndent: 16),
|
||||
// _buildSettingsTile(
|
||||
// icon: Icons.map_outlined,
|
||||
// color: Colors.green,
|
||||
// title: 'Change Country'.tr,
|
||||
// subtitle: 'You can change the Country to get all features'.tr,
|
||||
// onTap: () => Get.to(() => const CountryPickerFromSetting()),
|
||||
// ),
|
||||
Divider(
|
||||
height: 1,
|
||||
indent: 68,
|
||||
endIndent: 16,
|
||||
color: AppColor.grayColor.withOpacity(0.1)),
|
||||
GetBuilder<LocaleController>(
|
||||
builder: (localeController) {
|
||||
return _buildSettingsTile(
|
||||
icon: Icons.palette_outlined,
|
||||
color: Colors.deepPurpleAccent,
|
||||
title: 'Appearance'.tr,
|
||||
subtitle: (localeController.themeMode == ThemeMode.system
|
||||
? 'System Default'.tr
|
||||
: localeController.themeMode == ThemeMode.dark
|
||||
? 'Dark Mode'.tr
|
||||
: 'Light Mode'.tr)
|
||||
.tr,
|
||||
onTap: () => _showThemeSheet(context, localeController),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
@@ -136,7 +150,7 @@ class SettingPage extends StatelessWidget {
|
||||
child: Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
color: Colors.grey[700],
|
||||
color: AppColor.grayColor,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 15,
|
||||
),
|
||||
@@ -144,11 +158,73 @@ class SettingPage extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
void _showThemeSheet(BuildContext context, LocaleController controller) {
|
||||
final options = [
|
||||
{'label': 'System Default'.tr, 'mode': ThemeMode.system},
|
||||
{'label': 'Light Mode'.tr, 'mode': ThemeMode.light},
|
||||
{'label': 'Dark Mode'.tr, 'mode': ThemeMode.dark},
|
||||
];
|
||||
|
||||
Get.bottomSheet(
|
||||
Container(
|
||||
padding: const EdgeInsets.all(20),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.secondaryColor,
|
||||
borderRadius: const BorderRadius.vertical(top: Radius.circular(20)),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Container(
|
||||
width: 40,
|
||||
height: 4,
|
||||
margin: const EdgeInsets.only(bottom: 20),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.grayColor.withOpacity(0.3),
|
||||
borderRadius: BorderRadius.circular(2),
|
||||
),
|
||||
),
|
||||
Text('Select Appearance'.tr,
|
||||
style: AppStyle.headTitle2.copyWith(fontSize: 18)),
|
||||
const SizedBox(height: 20),
|
||||
...options.map((opt) {
|
||||
final isSelected = controller.themeMode == opt['mode'];
|
||||
return ListTile(
|
||||
title: Text(opt['label'] as String,
|
||||
style: TextStyle(
|
||||
color: isSelected
|
||||
? AppColor.primaryColor
|
||||
: AppColor.writeColor,
|
||||
fontWeight:
|
||||
isSelected ? FontWeight.bold : FontWeight.normal)),
|
||||
trailing: isSelected
|
||||
? Icon(Icons.check_circle, color: AppColor.primaryColor)
|
||||
: null,
|
||||
onTap: () {
|
||||
Get.back();
|
||||
controller.changeThemeMode(opt['mode'] as ThemeMode);
|
||||
},
|
||||
);
|
||||
}).toList(),
|
||||
const SizedBox(height: 20),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildSettingsCard({required List<Widget> children}) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
color: AppColor.secondaryColor,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.05),
|
||||
blurRadius: 10,
|
||||
offset: const Offset(0, 4),
|
||||
)
|
||||
],
|
||||
),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
child: Column(
|
||||
@@ -175,10 +251,14 @@ class SettingPage extends StatelessWidget {
|
||||
child: Icon(icon, color: color, size: 22),
|
||||
),
|
||||
title: Text(title,
|
||||
style: const TextStyle(fontWeight: FontWeight.w500, fontSize: 16)),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w500,
|
||||
fontSize: 16,
|
||||
color: AppColor.writeColor)),
|
||||
subtitle: Text(subtitle,
|
||||
style: TextStyle(color: Colors.grey[600], fontSize: 13)),
|
||||
trailing: Icon(Icons.chevron_right, color: Colors.grey[400]),
|
||||
style: TextStyle(color: AppColor.grayColor, fontSize: 13)),
|
||||
trailing:
|
||||
Icon(Icons.chevron_right, color: AppColor.grayColor.withOpacity(0.5)),
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 6),
|
||||
);
|
||||
}
|
||||
@@ -201,9 +281,12 @@ class SettingPage extends StatelessWidget {
|
||||
child: Icon(icon, color: color, size: 22),
|
||||
),
|
||||
title: Text(title,
|
||||
style: const TextStyle(fontWeight: FontWeight.w500, fontSize: 16)),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w500,
|
||||
fontSize: 16,
|
||||
color: AppColor.writeColor)),
|
||||
subtitle: Text(subtitle,
|
||||
style: TextStyle(color: Colors.grey[600], fontSize: 13)),
|
||||
style: TextStyle(color: AppColor.grayColor, fontSize: 13)),
|
||||
value: value,
|
||||
onChanged: onChanged,
|
||||
activeColor: const Color(0xFF007AFF), // iOS-like blue
|
||||
|
||||
Reference in New Issue
Block a user