Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Styling: Black Color to the font of the text in the button #560

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
201 changes: 99 additions & 102 deletions lib/app/modules/settings/views/customize_undo_duration.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:get/get_core/src/get_main.dart';
Expand All @@ -9,10 +8,10 @@ import '../../../utils/utils.dart';
import '../controllers/theme_controller.dart';
import 'package:ultimate_alarm_clock/app/modules/settings/controllers/settings_controller.dart';

class CustomizeUndoDuration extends StatelessWidget{
class CustomizeUndoDuration extends StatelessWidget {
HomeController homeController = Get.find<HomeController>();
CustomizeUndoDuration({
super.key ,
super.key,
required this.themeController,
required this.height,
required this.width,
Expand All @@ -25,113 +24,111 @@ class CustomizeUndoDuration extends StatelessWidget{
Widget build(BuildContext context) {
int duration;
return InkWell(
onTap: () {
Utils.hapticFeedback();
duration = homeController.duration.value;
Get.defaultDialog(
onWillPop: () async {
Get.back();
// Resetting the value to its initial state
homeController.duration.value = duration;
return true;
},
titlePadding: const EdgeInsets.symmetric(vertical: 20, horizontal: 5),
backgroundColor: themeController.isLightMode.value
? kLightSecondaryBackgroundColor
: ksecondaryBackgroundColor,
title: 'Customize Undo Duration'.tr,
titleStyle: Theme.of(context).textTheme.displaySmall,
content: Obx(
() => Column(
children: [
Text(
'${homeController.duration.value} seconds'.tr,
style: Theme.of(context).textTheme.displaySmall,
),
Slider(
value: homeController.selecteddurationDouble.value,
onChanged: (double value) {
homeController.selecteddurationDouble.value = value;
homeController.duration.value = value.toInt();

},
min: 0.0,
max: 20.0,
divisions: 20,
label: homeController.duration.value.toString(),
),
// Replace the volMin Slider with RangeSlider

ElevatedButton(
onPressed: () {
Get.back();
},
style: ElevatedButton.styleFrom(
backgroundColor: kprimaryColor,
onTap: () {
Utils.hapticFeedback();
duration = homeController.duration.value;
Get.defaultDialog(
onWillPop: () async {
Get.back();
// Resetting the value to its initial state
homeController.duration.value = duration;
return true;
},
titlePadding:
const EdgeInsets.symmetric(vertical: 20, horizontal: 5),
backgroundColor: themeController.isLightMode.value
? kLightSecondaryBackgroundColor
: ksecondaryBackgroundColor,
title: 'Customize Undo Duration'.tr,
titleStyle: Theme.of(context).textTheme.displaySmall,
content: Obx(
() => Column(
children: [
Text(
'${homeController.duration.value} seconds'.tr,
style: Theme.of(context).textTheme.displaySmall,
),
child: Text(
'Apply Duration'.tr,
style: TextStyle(
color: themeController.isLightMode.value
? kLightSecondaryTextColor
: ksecondaryTextColor,
Slider(
value: homeController.selecteddurationDouble.value,
onChanged: (double value) {
homeController.selecteddurationDouble.value = value;
homeController.duration.value = value.toInt();
},
min: 0.0,
max: 20.0,
divisions: 20,
label: homeController.duration.value.toString(),
),
// Replace the volMin Slider with RangeSlider

ElevatedButton(
onPressed: () {
Get.back();
},
style: ElevatedButton.styleFrom(
backgroundColor: kprimaryColor,
),
child: Text(
'Apply Duration'.tr,
style: Theme.of(context).textTheme.displaySmall!.copyWith(
color: themeController.isLightMode.value
? kLightPrimaryTextColor
: ksecondaryTextColor,
),
),
),
),
],
),
),
);
},
child: Container(
width: width * 0.91,
height: height * 0.09,
decoration: Utils.getCustomTileBoxDecoration(
isLightMode: themeController.isLightMode.value,
),
child: Center(
child: Padding(
padding: EdgeInsets.only(left: 10, right: 10),
child: ListTile(
tileColor: themeController.isLightMode.value
? kLightSecondaryBackgroundColor
: ksecondaryBackgroundColor,
title: Text(
'Undo Duration'.tr,
style: TextStyle(
color: themeController.isLightMode.value
? kLightPrimaryTextColor
: kprimaryTextColor,
fontSize: 15
),
],
),
trailing: Wrap(
crossAxisAlignment: WrapCrossAlignment.center,
children: [
Obx(
() => Text(
'${homeController.duration.value.round().toInt()} seconds',
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
),
);
},
child: Container(
width: width * 0.91,
height: height * 0.09,
decoration: Utils.getCustomTileBoxDecoration(
isLightMode: themeController.isLightMode.value,
),
child: Center(
child: Padding(
padding: EdgeInsets.only(left: 10, right: 10),
child: ListTile(
tileColor: themeController.isLightMode.value
? kLightSecondaryBackgroundColor
: ksecondaryBackgroundColor,
title: Text(
'Undo Duration'.tr,
style: TextStyle(
color: themeController.isLightMode.value
? kLightPrimaryTextColor
: kprimaryTextColor,
fontSize: 13
),
),
fontSize: 15),
),
Icon(
Icons.chevron_right,
color: themeController.isLightMode.value
? kLightPrimaryDisabledTextColor
: kprimaryDisabledTextColor,
trailing: Wrap(
crossAxisAlignment: WrapCrossAlignment.center,
children: [
Obx(
() => Text(
'${homeController.duration.value.round().toInt()} seconds',
style: Theme.of(context)
.textTheme
.bodyMedium!
.copyWith(
color: themeController.isLightMode.value
? kLightPrimaryTextColor
: kprimaryTextColor,
fontSize: 13),
),
),
Icon(
Icons.chevron_right,
color: themeController.isLightMode.value
? kLightPrimaryDisabledTextColor
: kprimaryDisabledTextColor,
),
],
),
],
),
),
),
),
)
)
);
)));
}

}
}