Skip to content

Commit 0e0bc9f

Browse files
authored
Bug: AM and PM in the addOrUpdateAlarm the text is not fully completed (#669)
* Update add_or_update_alarm_view.dart * removed getFontSize funtion * Update add_or_update_alarm_view.dart * Update utils.dart
1 parent afd4d56 commit 0e0bc9f

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ class AddOrUpdateAlarmView extends GetView<AddOrUpdateAlarmController> {
8080
controller.timeToAlarm.value.toString(),
8181
},
8282
),
83-
style: Theme.of(context).textTheme.titleSmall,
83+
style: Theme.of(context)
84+
.textTheme
85+
.titleSmall,
8486
),
8587
),
8688
),
@@ -240,6 +242,7 @@ class AddOrUpdateAlarmView extends GetView<AddOrUpdateAlarmController> {
240242
.selectedTime
241243
.value
242244
.minute,
245+
243246
);
244247
inputTimeController
245248
.inputHrsController
@@ -521,16 +524,14 @@ class AddOrUpdateAlarmView extends GetView<AddOrUpdateAlarmController> {
521524
.value;
522525
},
523526
itemWidth:
524-
width * 0.17,
527+
width * 0.2,
525528
selectedTextStyle:
526529
Theme.of(
527530
context)
528531
.textTheme
529532
.displayLarge!
530533
.copyWith(
531-
fontSize:
532-
controller.homeController.scalingFactor *
533-
40,
534+
fontSize: Utils.getFontSize(context),
534535
fontWeight:
535536
FontWeight
536537
.bold,
@@ -542,10 +543,9 @@ class AddOrUpdateAlarmView extends GetView<AddOrUpdateAlarmController> {
542543
.textTheme
543544
.displayMedium!
544545
.copyWith(
545-
fontSize: controller
546-
.homeController
547-
.scalingFactor *
548-
20,
546+
fontSize:
547+
Utils.getFontSize(
548+
context),
549549
color: themeController
550550
.primaryDisabledTextColor
551551
.value,

lib/app/utils/utils.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -826,4 +826,8 @@ class Utils {
826826
return parts[0].substring(0, 2);
827827
}
828828
}
829+
static double getFontSize(BuildContext context) {
830+
final width = MediaQuery.of(context).size.width;
831+
return width < 360 ? 14 : 30;
832+
}
829833
}

0 commit comments

Comments
 (0)