Skip to content

Commit e3a1adf

Browse files
Merge pull request #619 from ganidande905/add_responsiveness
Add bug: added responsiveness where ever needed
2 parents ab258c1 + 1d96600 commit e3a1adf

17 files changed

+914
-838
lines changed

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

Lines changed: 843 additions & 796 deletions
Large diffs are not rendered by default.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import 'package:flutter/material.dart';
22
import 'package:get/get.dart';
33

4-
import '../../../utils/constants.dart';
54
import '../../settings/controllers/theme_controller.dart';
65
import '../controllers/add_or_update_alarm_controller.dart';
76

@@ -17,6 +16,7 @@ class AlarmDateTile extends StatelessWidget {
1716

1817
@override
1918
Widget build(BuildContext context) {
19+
2020
return Obx(() => InkWell(
2121
onTap: () async {
2222
controller.datePicker(context);

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@ class MathsChallenge extends StatelessWidget {
1818

1919
@override
2020
Widget build(BuildContext context) {
21-
var width = Get.width;
22-
var height = Get.height;
21+
// var width = Get.width;
22+
// var height = Get.height;
23+
final double width = MediaQuery.of(context).size.width;
24+
// ignore: unused_local_variable
25+
final double height = MediaQuery.of(context).size.height;
2326
double sliderValue;
2427
int noOfMathQues;
2528
bool isMathsEnabled;

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ class NoteTile extends StatelessWidget {
1717

1818
@override
1919
Widget build(BuildContext context) {
20+
final double width = MediaQuery.of(context).size.width;
21+
// ignore: unused_local_variable
22+
final double height = MediaQuery.of(context).size.height;
2023
return Obx(
2124
() => ListTile(
2225

@@ -49,21 +52,21 @@ class NoteTile extends StatelessWidget {
4952
enabledBorder: OutlineInputBorder(
5053
borderSide: BorderSide(
5154
color: themeController.primaryTextColor.value.withOpacity(0.75),
52-
width: 1,
55+
width: width*0.01,
5356
),
5457
borderRadius: const BorderRadius.all(Radius.circular(12)),
5558
),
5659
border: OutlineInputBorder(
5760
borderSide: BorderSide(
5861
color: themeController.primaryTextColor.value.withOpacity(0.75),
59-
width: 1,
62+
width: width*0.01,
6063
),
6164
borderRadius: const BorderRadius.all(Radius.circular(12)),
6265
),
6366
focusedBorder: OutlineInputBorder(
6467
borderSide: BorderSide(
6568
color: themeController.primaryTextColor.value.withOpacity(0.75),
66-
width: 1,
69+
width: width*0.01,
6770
),
6871
borderRadius: const BorderRadius.all(Radius.circular(12)),
6972
),
@@ -112,7 +115,7 @@ class NoteTile extends StatelessWidget {
112115
children: [
113116
Obx(
114117
() => Container(
115-
width: 100,
118+
width: width*0.1,
116119
alignment: Alignment.centerRight,
117120
child: Text(
118121
(controller.note.value.trim().isNotEmpty)

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ class RepeatTile extends StatelessWidget {
1818
@override
1919
Widget build(BuildContext context) {
2020
List<bool> repeatDays = List<bool>.filled(7, false);
21+
// ignore: unused_local_variable
2122
var height = Get.height;
2223
var width = Get.width;
2324

25+
2426
return Obx(
2527
() => InkWell(
2628
onTap: () {
@@ -60,10 +62,7 @@ class RepeatTile extends StatelessWidget {
6062
width: width,
6163
child: Padding(
6264
padding: const EdgeInsets.only(
63-
left: 25,
64-
right: 25,
65-
bottom: 25
66-
),
65+
left: 25, right: 25, bottom: 25),
6766
child: TextButton(
6867
style: ButtonStyle(
6968
backgroundColor: MaterialStateProperty.all(
@@ -81,7 +80,7 @@ class RepeatTile extends StatelessWidget {
8180
.displaySmall!
8281
.copyWith(
8382
color: controller.themeController
84-
.secondaryTextColor.value,
83+
.secondaryTextColor.value,
8584
),
8685
),
8786
),
@@ -95,7 +94,6 @@ class RepeatTile extends StatelessWidget {
9594
);
9695
},
9796
child: ListTile(
98-
9997
title: Obx(
10098
() {
10199
bool anyDaySelected =
@@ -311,7 +309,8 @@ class RepeatTile extends StatelessWidget {
311309
.textTheme
312310
.displaySmall!
313311
.copyWith(
314-
color: themeController.secondaryTextColor.value,
312+
color:
313+
themeController.secondaryTextColor.value,
315314
),
316315
),
317316
),

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ class SharedAlarm extends StatelessWidget {
1919

2020
@override
2121
Widget build(BuildContext context) {
22-
var width = Get.width;
23-
var height = Get.height;
22+
// var width = Get.width;
23+
// var height = Get.height;
24+
final double width = MediaQuery.of(context).size.width;
25+
final double height = MediaQuery.of(context).size.height;
2426

2527
return Obx(() => Container(
2628
child: (controller.userModel.value != null)

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

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ class WeatherTile extends StatelessWidget {
1717

1818
@override
1919
Widget build(BuildContext context) {
20-
var width = Get.width;
21-
var height = Get.height;
20+
// var width = Get.width;
21+
// var height = Get.height;
22+
final double width = MediaQuery.of(context).size.width;
23+
final double height = MediaQuery.of(context).size.height;
2224
return Obx(
2325
() => Container(
2426
child: ListTile(
@@ -53,7 +55,7 @@ class WeatherTile extends StatelessWidget {
5355
children: [
5456
Checkbox.adaptive(
5557
side: BorderSide(
56-
width: 1.5,
58+
width: width*0.0015,
5759
color: themeController.primaryTextColor.value.withOpacity(0.5),
5860
),
5961
value: controller.selectedWeather
@@ -102,7 +104,7 @@ class WeatherTile extends StatelessWidget {
102104
children: [
103105
Checkbox.adaptive(
104106
side: BorderSide(
105-
width: 1.5,
107+
width: width*0.0015,
106108
color: themeController.primaryTextColor.value.withOpacity(0.5),
107109
),
108110
value: controller.selectedWeather
@@ -152,7 +154,7 @@ class WeatherTile extends StatelessWidget {
152154
children: [
153155
Checkbox.adaptive(
154156
side: BorderSide(
155-
width: 1.5,
157+
width: width*0.0015,
156158
color: themeController.primaryTextColor.value.withOpacity(0.5),
157159
),
158160
value: controller.selectedWeather
@@ -201,7 +203,7 @@ class WeatherTile extends StatelessWidget {
201203
children: [
202204
Checkbox.adaptive(
203205
side: BorderSide(
204-
width: 1.5,
206+
width: width*0.0015,
205207
color: themeController.primaryTextColor.value.withOpacity(0.5),
206208
),
207209
value: controller.selectedWeather
@@ -250,7 +252,7 @@ class WeatherTile extends StatelessWidget {
250252
children: [
251253
Checkbox.adaptive(
252254
side: BorderSide(
253-
width: 1.5,
255+
width: width*0.0015,
254256
color: themeController.primaryTextColor.value.withOpacity(0.5),
255257
),
256258
value: controller.selectedWeather

lib/app/modules/alarmChallenge/views/alarm_challenge_view.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,18 @@ import 'package:ultimate_alarm_clock/app/utils/utils.dart';
1010

1111
import '../controllers/alarm_challenge_controller.dart';
1212

13+
// ignore: must_be_immutable
1314
class AlarmChallengeView extends GetView<AlarmChallengeController> {
1415
AlarmChallengeView({Key? key}) : super(key: key);
1516

1617
ThemeController themeController = Get.find<ThemeController>();
1718

1819
@override
1920
Widget build(BuildContext context) {
20-
var width = Get.width;
21-
var height = Get.height;
21+
// var width = Get.width;
22+
// var height = Get.height;
23+
final double width = MediaQuery.of(context).size.width;
24+
final double height = MediaQuery.of(context).size.height;
2225

2326
return GestureDetector(
2427
onTap: () {

lib/app/modules/alarmChallenge/views/maths_challenge_view.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,18 @@ import 'package:ultimate_alarm_clock/app/modules/settings/controllers/theme_cont
55
import 'package:ultimate_alarm_clock/app/utils/constants.dart';
66
import 'package:ultimate_alarm_clock/app/utils/utils.dart';
77

8+
// ignore: must_be_immutable
89
class MathsChallengeView extends GetView<AlarmChallengeController> {
910
MathsChallengeView({Key? key}) : super(key: key);
1011

1112
ThemeController themeController = Get.find<ThemeController>();
1213

1314
@override
1415
Widget build(BuildContext context) {
15-
var height = Get.height;
16-
var width = Get.width;
16+
// var height = Get.height;
17+
// var width = Get.width;
18+
final double width = MediaQuery.of(context).size.width;
19+
final double height = MediaQuery.of(context).size.height;
1720
return GestureDetector(
1821
onTap: () {
1922
Utils.hapticFeedback();

lib/app/modules/alarmChallenge/views/pedometer_challenge_view.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ class PedometerChallengeView extends GetView<AlarmChallengeController> {
1414

1515
@override
1616
Widget build(BuildContext context) {
17-
var height = Get.height;
17+
// var height = Get.height;
18+
// ignore: unused_local_variable
19+
final double width = MediaQuery.of(context).size.width;
20+
final double height = MediaQuery.of(context).size.height;
1821

1922
return Scaffold(
2023
appBar: AppBar(

0 commit comments

Comments
 (0)