diff --git a/lib/app/modules/addOrUpdateAlarm/controllers/add_or_update_alarm_controller.dart b/lib/app/modules/addOrUpdateAlarm/controllers/add_or_update_alarm_controller.dart index 7eaab414..3acc17b1 100644 --- a/lib/app/modules/addOrUpdateAlarm/controllers/add_or_update_alarm_controller.dart +++ b/lib/app/modules/addOrUpdateAlarm/controllers/add_or_update_alarm_controller.dart @@ -72,7 +72,7 @@ class AddOrUpdateAlarmController extends GetxController { final mathsSliderValue = 0.0.obs; final mathsDifficulty = Difficulty.Easy.obs; final isMathsEnabled = false.obs; - final numMathsQuestions = 1.obs; + final numMathsQuestions = 0.obs; final MapController mapController = MapController(); final selectedPoint = LatLng(0, 0).obs; final RxList markersList = [].obs; diff --git a/lib/app/modules/addOrUpdateAlarm/views/maths_challenge_tile.dart b/lib/app/modules/addOrUpdateAlarm/views/maths_challenge_tile.dart index d9f49627..217d5dff 100644 --- a/lib/app/modules/addOrUpdateAlarm/views/maths_challenge_tile.dart +++ b/lib/app/modules/addOrUpdateAlarm/views/maths_challenge_tile.dart @@ -111,15 +111,15 @@ class MathsChallenge extends StatelessWidget { ], ), Obx( - () => Padding( - padding: const EdgeInsets.symmetric(vertical: 10.0), + () => Padding( + padding: const EdgeInsets.only(bottom: 10.0), child: Row( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ NumberPicker( value: controller.numMathsQuestions.value, - minValue: 1, + minValue: 0, maxValue: 100, onChanged: (value) { Utils.hapticFeedback(); @@ -152,7 +152,11 @@ class MathsChallenge extends StatelessWidget { ), onPressed: () async { Utils.hapticFeedback(); - controller.isMathsEnabled.value = true; + if (controller.numMathsQuestions.value != 0) { + controller.isMathsEnabled.value = true; + } else { + controller.isMathsEnabled.value = false; + } Get.back(); }, ), @@ -191,7 +195,7 @@ class MathsChallenge extends StatelessWidget { children: [ Obx( () => Text( - controller.isMathsEnabled == true + controller.isMathsEnabled.value == true ? Utils.getDifficultyLabel(controller.mathsDifficulty.value) .tr : 'Off'.tr,