@@ -22,7 +22,6 @@ class RepeatTile extends StatelessWidget {
2222 var height = Get .height;
2323 var width = Get .width;
2424
25-
2625 return Obx (
2726 () => InkWell (
2827 onTap: () {
@@ -172,7 +171,15 @@ class RepeatTile extends StatelessWidget {
172171 activeColor: kprimaryColor.withOpacity (0.8 ),
173172 value: controller.isDailySelected.value,
174173 onChanged: (value) {
175- // This onChanged can be empty, as we handle the tap in InkWell
174+ Utils .hapticFeedback ();
175+ controller
176+ .setIsDailySelected (! controller.isDailySelected.value);
177+
178+ // Update repeatDays based on isDailySelected value
179+ for (int i = 0 ; i < controller.repeatDays.length; i++ ) {
180+ controller.repeatDays[i] =
181+ controller.isDailySelected.value;
182+ }
176183 },
177184 ),
178185 ],
@@ -364,9 +371,9 @@ class RepeatTile extends StatelessWidget {
364371
365372 // Update repeatDays based on isWeekdaysSelected value
366373 for (int i = 0 ; i < controller.repeatDays.length; i++ ) {
367- // Assuming weekdays are from Monday to Friday (index 0 to 5 )
374+ // Assuming weekdays are from Monday to Friday (index 0 to 4 )
368375 controller.repeatDays[i] =
369- controller.isWeekdaysSelected.value && i >= 0 && i < 5 ;
376+ controller.isWeekdaysSelected.value && i >= 0 && i <= 4 ;
370377 }
371378 },
372379 child: Padding (
@@ -394,11 +401,11 @@ class RepeatTile extends StatelessWidget {
394401
395402 // Update repeatDays based on isWeekdaysSelected value
396403 for (int i = 0 ; i < controller.repeatDays.length; i++ ) {
397- // Assuming weekdays are from Monday to Friday (index 1 to 5 )
404+ // Assuming weekdays are from Monday to Friday (index 0 to 4 )
398405 controller.repeatDays[i] =
399406 controller.isWeekdaysSelected.value &&
400- i >= 1 &&
401- i <= 5 ;
407+ i >= 0 &&
408+ i <= 4 ;
402409 }
403410 },
404411 ),
0 commit comments