Skip to content

Commit 5efcb01

Browse files
Merge pull request #607 from Gaurav-Kushwaha-1225/MathsChallengeDialog
Add fix #606: Overflow Issue Resolved
2 parents 8e7c393 + 4048a78 commit 5efcb01

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

lib/app/modules/addOrUpdateAlarm/controllers/add_or_update_alarm_controller.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class AddOrUpdateAlarmController extends GetxController {
7272
final mathsSliderValue = 0.0.obs;
7373
final mathsDifficulty = Difficulty.Easy.obs;
7474
final isMathsEnabled = false.obs;
75-
final numMathsQuestions = 1.obs;
75+
final numMathsQuestions = 0.obs;
7676
final MapController mapController = MapController();
7777
final selectedPoint = LatLng(0, 0).obs;
7878
final RxList markersList = [].obs;

lib/app/modules/addOrUpdateAlarm/views/maths_challenge_tile.dart

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,15 @@ class MathsChallenge extends StatelessWidget {
111111
],
112112
),
113113
Obx(
114-
() => Padding(
115-
padding: const EdgeInsets.symmetric(vertical: 10.0),
114+
() => Padding(
115+
padding: const EdgeInsets.only(bottom: 10.0),
116116
child: Row(
117117
mainAxisAlignment: MainAxisAlignment.center,
118118
crossAxisAlignment: CrossAxisAlignment.center,
119119
children: [
120120
NumberPicker(
121121
value: controller.numMathsQuestions.value,
122-
minValue: 1,
122+
minValue: 0,
123123
maxValue: 100,
124124
onChanged: (value) {
125125
Utils.hapticFeedback();
@@ -152,7 +152,11 @@ class MathsChallenge extends StatelessWidget {
152152
),
153153
onPressed: () async {
154154
Utils.hapticFeedback();
155-
controller.isMathsEnabled.value = true;
155+
if (controller.numMathsQuestions.value != 0) {
156+
controller.isMathsEnabled.value = true;
157+
} else {
158+
controller.isMathsEnabled.value = false;
159+
}
156160
Get.back();
157161
},
158162
),
@@ -191,7 +195,7 @@ class MathsChallenge extends StatelessWidget {
191195
children: [
192196
Obx(
193197
() => Text(
194-
controller.isMathsEnabled == true
198+
controller.isMathsEnabled.value == true
195199
? Utils.getDifficultyLabel(controller.mathsDifficulty.value)
196200
.tr
197201
: 'Off'.tr,

0 commit comments

Comments
 (0)