Skip to content

Commit

Permalink
Merge pull request #607 from Gaurav-Kushwaha-1225/MathsChallengeDialog
Browse files Browse the repository at this point in the history
Add fix #606: Overflow Issue Resolved
  • Loading branch information
AryanSarafDev authored Nov 11, 2024
2 parents 8e7c393 + 4048a78 commit 5efcb01
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
14 changes: 9 additions & 5 deletions lib/app/modules/addOrUpdateAlarm/views/maths_challenge_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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();
},
),
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 5efcb01

Please sign in to comment.