@@ -36,49 +36,64 @@ class SnoozeDurationTile extends StatelessWidget {
3636 backgroundColor: themeController.secondaryBackgroundColor.value,
3737 title: 'Select duration' .tr,
3838 titleStyle: Theme .of (context).textTheme.displaySmall,
39- content: Obx (
40- () => Column (
41- children: [
42- Padding (
43- padding: const EdgeInsets .symmetric (vertical: 10.0 ),
44- child: Row (
45- mainAxisAlignment: MainAxisAlignment .center,
46- crossAxisAlignment: CrossAxisAlignment .center,
47- children: [
48- NumberPicker (
49- value: controller.snoozeDuration.value,
50- minValue: 1 ,
51- maxValue: 1440 ,
52- onChanged: (value) {
53- Utils .hapticFeedback ();
54- controller.snoozeDuration.value = value;
55- },
39+ content: SizedBox (
40+ height: MediaQuery .of (context).size.height * 0.3 ,
41+ child: Obx (
42+ () => Column (
43+ mainAxisAlignment: MainAxisAlignment .center,
44+ mainAxisSize: MainAxisSize .min,
45+ children: [
46+ Padding (
47+ padding: const EdgeInsets .symmetric (vertical: 10.0 ),
48+ child: Row (
49+ mainAxisAlignment: MainAxisAlignment .center,
50+ crossAxisAlignment: CrossAxisAlignment .center,
51+ children: [
52+ NumberPicker (
53+ value: controller.snoozeDuration.value <= 0
54+ ? 1
55+ : controller.snoozeDuration
56+ .value, // Handle 0 or negative values
57+ minValue: 1 ,
58+ maxValue: 1440 ,
59+ onChanged: (value) {
60+ Utils .hapticFeedback ();
61+ controller.snoozeDuration.value = value;
62+ },
63+ ),
64+ Text (
65+ controller.snoozeDuration.value > 1
66+ ? 'minutes' .tr
67+ : 'minute' .tr,
68+ ),
69+ ],
70+ ),
71+ ),
72+ Padding (
73+ padding: const EdgeInsets .only (bottom: 10 ),
74+ child: ElevatedButton (
75+ onPressed: () {
76+ Utils .hapticFeedback ();
77+ Get .back ();
78+ },
79+ style: ElevatedButton .styleFrom (
80+ backgroundColor: kprimaryColor,
5681 ),
57- Text (
58- controller.snoozeDuration.value > 1
59- ? 'minutes' .tr
60- : 'minute' .tr,
82+ child: Text (
83+ 'Done' .tr,
84+ style: Theme .of (context)
85+ .textTheme
86+ .displaySmall!
87+ .copyWith (
88+ color: themeController.secondaryTextColor.value,
89+ ),
6190 ),
62- ],
63- ),
64- ),
65- ElevatedButton (
66- onPressed: () {
67- Utils .hapticFeedback ();
68- Get .back ();
69- },
70- style: ElevatedButton .styleFrom (
71- backgroundColor: kprimaryColor,
72- ),
73- child: Text (
74- 'Done' .tr,
75- style: Theme .of (context).textTheme.displaySmall! .copyWith (
76- color: themeController.secondaryTextColor.value,
77- ),
91+ ),
7892 ),
79- ) ,
80- ] ,
93+ ] ,
94+ ) ,
8195 ),
96+ // ),
8297 ),
8398 );
8499 },
0 commit comments