Skip to content

Commit 1b0117d

Browse files
committed
chor: requested changes
Signed-off-by: Aman <aman2@me.iitr.ac.in>
1 parent 196bf2b commit 1b0117d

24 files changed

Lines changed: 203 additions & 212 deletions

lib/data/constants/colors.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
22

33
class AppColors {
44
static const Color white = Colors.white;
5-
static const Color white1 = Color(0xFFE5E5E5);
65
static const Color grey1 = Color(0xFF979797);
76
static const Color grey2 = Color(0xFFC5CEE0);
87
static const Color grey3 = Color(0xFF242424);

lib/data/services/local/image_service.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class ImageService {
3131
compressQuality: 100,
3232
maxHeight: 1000,
3333
maxWidth: 1000,
34+
cropStyle: CropStyle.circle,
3435
compressFormat: ImageCompressFormat.png,
3536
);
3637
return croppedImage;

lib/presentation/contests/widgets/contest_card.dart

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class ContestCard extends StatelessWidget {
4444
},
4545
child: Padding(
4646
padding: EdgeInsets.symmetric(
47-
vertical: 10.h,
47+
vertical: 10.r,
4848
),
4949
child: Row(
5050
mainAxisAlignment: MainAxisAlignment.spaceBetween,
@@ -69,7 +69,7 @@ class ContestCard extends StatelessWidget {
6969
style: AppStyles.h6,
7070
),
7171
Padding(
72-
padding: EdgeInsets.symmetric(vertical: 6.h),
72+
padding: EdgeInsets.symmetric(vertical: 6.r),
7373
child: Text(
7474
upcoming != null ? upcoming!.name : ongoing!.name,
7575
style: AppStyles.h4.copyWith(
@@ -82,7 +82,7 @@ class ContestCard extends StatelessWidget {
8282
SvgPicture.asset(
8383
AppAssets.clock,
8484
),
85-
SizedBox(width: 4.w),
85+
SizedBox(width: 4.r),
8686
Text(
8787
upcoming != null ? upcoming!.time : ongoing!.time,
8888
style: AppStyles.h6,
@@ -110,7 +110,7 @@ class ContestCard extends StatelessWidget {
110110
),
111111
),
112112
title: Container(
113-
padding: EdgeInsets.symmetric(vertical: 10.h),
113+
padding: EdgeInsets.symmetric(vertical: 10.r),
114114
decoration: BoxDecoration(
115115
color: AppColors.grey7,
116116
borderRadius: BorderRadius.vertical(
@@ -135,13 +135,13 @@ class ContestCard extends StatelessWidget {
135135
),
136136
),
137137
child: SizedBox(
138-
height: 120.h,
138+
height: 120.r,
139139
child: Column(
140140
children: [
141141
Padding(
142142
padding: EdgeInsets.symmetric(
143-
horizontal: 30.w,
144-
vertical: 10.h,
143+
horizontal: 30.r,
144+
vertical: 10.r,
145145
),
146146
child: Text(
147147
'You will be reminded before the contest starts. Set the timer',
@@ -159,8 +159,8 @@ class ContestCard extends StatelessWidget {
159159
valueListenable: _remindNotifer,
160160
builder: (context, value, _) {
161161
return SizedBox(
162-
height: 60.h,
163-
width: 30.w,
162+
height: 60.r,
163+
width: 30.r,
164164
child: ListWheelScrollView(
165165
controller:
166166
FixedExtentScrollController(
@@ -190,7 +190,7 @@ class ContestCard extends StatelessWidget {
190190
);
191191
},
192192
),
193-
SizedBox(width: 4.w),
193+
SizedBox(width: 4.r),
194194
Text(
195195
'minutes',
196196
style: AppStyles.h6.copyWith(
@@ -218,8 +218,8 @@ class ContestCard extends StatelessWidget {
218218
},
219219
child: Container(
220220
padding: EdgeInsets.symmetric(
221-
horizontal: 40.w,
222-
vertical: 10.h,
221+
horizontal: 40.r,
222+
vertical: 10.r,
223223
),
224224
color: AppColors.grey10,
225225
child: Text(
@@ -255,8 +255,8 @@ class ContestCard extends StatelessWidget {
255255
},
256256
child: Container(
257257
padding: EdgeInsets.symmetric(
258-
horizontal: 40.w,
259-
vertical: 10.h,
258+
horizontal: 40.r,
259+
vertical: 10.r,
260260
),
261261
color: AppColors.primary,
262262
child: Text(

lib/presentation/contests/widgets/filter_sheet.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class FilterSheet extends StatelessWidget {
2525

2626
Widget _buildPlatfromIcon(String icon, VoidCallback callback, bool isActive) {
2727
return Padding(
28-
padding: EdgeInsets.only(left: 16.w, top: 10.h, bottom: 20.h),
28+
padding: EdgeInsets.only(left: 16.r, top: 10.r, bottom: 20.r),
2929
child: InkWell(
3030
onTap: callback,
3131
child: AnimatedOpacity(
@@ -87,7 +87,7 @@ class FilterSheet extends StatelessWidget {
8787
),
8888
),
8989
Padding(
90-
padding: EdgeInsets.only(left: 16.w, top: 10.h),
90+
padding: EdgeInsets.only(left: 16.r, top: 10.r),
9191
child: Text(
9292
'Platforms',
9393
style: AppStyles.h6.copyWith(
@@ -122,7 +122,7 @@ class FilterSheet extends StatelessWidget {
122122
),
123123
),
124124
Padding(
125-
padding: EdgeInsets.only(left: 16.w),
125+
padding: EdgeInsets.only(left: 16.r),
126126
child: Text(
127127
'Max. Duration',
128128
style: AppStyles.h6.copyWith(
@@ -155,7 +155,7 @@ class FilterSheet extends StatelessWidget {
155155
},
156156
),
157157
Padding(
158-
padding: EdgeInsets.only(left: 16.w),
158+
padding: EdgeInsets.only(left: 16.r),
159159
child: Text(
160160
'Start Date',
161161
style: AppStyles.h6.copyWith(

lib/presentation/contests/widgets/loading_state.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class LoadingState extends StatelessWidget {
2828
children: <Widget>[
2929
Container(
3030
margin: const EdgeInsets.fromLTRB(0, 15, 0, 10),
31-
width: 150.w,
31+
width: 150.r,
3232
decoration: BoxDecoration(
3333
borderRadius: BorderRadius.circular(2),
3434
color: const Color(0xFFE5E5E5),
@@ -37,7 +37,7 @@ class LoadingState extends StatelessWidget {
3737
),
3838
Container(
3939
margin: const EdgeInsets.fromLTRB(0, 0, 0, 10),
40-
width: 250.w,
40+
width: 250.r,
4141
height: 20,
4242
decoration: BoxDecoration(
4343
borderRadius: BorderRadius.circular(2),
@@ -46,7 +46,7 @@ class LoadingState extends StatelessWidget {
4646
),
4747
Container(
4848
margin: const EdgeInsets.fromLTRB(0, 0, 0, 15),
49-
width: 250.w,
49+
width: 250.r,
5050
height: 20,
5151
decoration: BoxDecoration(
5252
borderRadius: BorderRadius.circular(2),

lib/presentation/core/router.dart

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import 'package:flutter/material.dart';
2-
import 'package:flutter_bloc/flutter_bloc.dart';
32
import 'package:get/get.dart';
43

54
import '../../data/constants/routes.dart';
@@ -8,7 +7,6 @@ import '../login/login_screen.dart';
87
import '../onboarding/onboarding_screen.dart';
98
import '../signup/signup_screen.dart';
109
import '../signup/verify_screen.dart';
11-
import '../update_profile/bloc/update_profile_bloc.dart';
1210
import '../update_profile/update_profile.dart';
1311

1412
/// Wrapper for a single method to be passed to [GetMaterialApp.onGenerateRoute].
@@ -47,10 +45,7 @@ class AppRouter {
4745
);
4846
case AppRoutes.updateProfile:
4947
return GetPageRoute(
50-
page: () => BlocProvider(
51-
create: (context) => UpdateProfileBloc()..add(const Initialize()),
52-
child: const UpdateProfile(),
53-
),
48+
page: () => const UpdateProfile(),
5449
routeName: settings.name,
5550
settings: settings,
5651
);

lib/presentation/feed/widgets/feed_card.dart

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class FeedCard extends StatelessWidget {
4545
.add(const BottomNavItemPressed(index: 3));
4646
},
4747
child: Padding(
48-
padding: EdgeInsets.only(right: 10.w),
48+
padding: EdgeInsets.only(right: 10.r),
4949
child: feed.picture?.isEmpty ?? true
5050
? Container(
5151
decoration: BoxDecoration(
@@ -91,7 +91,7 @@ class FeedCard extends StatelessWidget {
9191
],
9292
),
9393
Padding(
94-
padding: EdgeInsets.symmetric(vertical: 5.h),
94+
padding: EdgeInsets.symmetric(vertical: 5.r),
9595
child: Text(
9696
'${feed.name}',
9797
style: Theme.of(context)
@@ -123,7 +123,7 @@ class FeedCard extends StatelessWidget {
123123
radius: 10.r,
124124
),
125125
SizedBox(
126-
width: 150.w,
126+
width: 150.r,
127127
child: Text(
128128
_makeNonBreaking(
129129
' ${PlatformUtil.getName(PlatformUtil.getNamefromUrl(feed.url))} |'
@@ -162,8 +162,8 @@ class FeedCard extends StatelessWidget {
162162
Container(
163163
color: AppColors.grey9,
164164
padding: EdgeInsets.symmetric(
165-
horizontal: 15.w,
166-
vertical: 10.h,
165+
horizontal: 15.r,
166+
vertical: 10.r,
167167
),
168168
child: Column(
169169
children: _buildSubmissions(feed.submissions!),
@@ -202,21 +202,21 @@ class FeedCard extends StatelessWidget {
202202
Column(
203203
children: <Widget>[
204204
Container(
205-
height: 9.h,
206-
width: 2.w,
205+
height: 9.r,
206+
width: 2.r,
207207
color: isFirst ? AppColors.white : AppColors.grey10,
208208
),
209209
Container(
210-
height: 8.h,
211-
width: 8.w,
210+
height: 8.r,
211+
width: 8.r,
212212
decoration: BoxDecoration(
213213
color: response['color'],
214214
shape: BoxShape.circle,
215215
),
216216
),
217217
Container(
218-
height: 9.h,
219-
width: 2.w,
218+
height: 9.r,
219+
width: 2.r,
220220
color: isLast ? AppColors.white : AppColors.grey10,
221221
)
222222
],

lib/presentation/home/bloc/home_bloc.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class HomeBloc extends Bloc<HomeEvent, HomeState> {
3232
StorageService.user = await UserRepository.fetchUserDetails();
3333
} on Exception catch (err) {
3434
debugPrint(err.toString());
35+
rethrow;
3536
}
3637
}
3738

lib/presentation/profile/components/button.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ class Button extends StatelessWidget {
2626
onTap: onTap,
2727
child: Padding(
2828
padding: EdgeInsets.symmetric(
29-
horizontal: 6.w,
30-
vertical: 5.h,
29+
horizontal: 6.r,
30+
vertical: 5.r,
3131
),
3232
child: Container(
3333
decoration: BoxDecoration(

lib/presentation/profile/profile_screen.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,24 +43,24 @@ class ProfileScreen extends StatelessWidget {
4343
children: [
4444
const ProfileHeader(),
4545
Padding(
46-
padding: EdgeInsets.fromLTRB(16.w, 24.h, 0, 8.h),
46+
padding: EdgeInsets.fromLTRB(16.r, 24.r, 0, 8.r),
4747
child: Text(
4848
'Accuracy',
4949
style: AppStyles.h1.copyWith(fontSize: 15.sp),
5050
),
5151
),
5252
const AccuracyDisplay(),
53-
SizedBox(height: 30.h),
53+
SizedBox(height: 30.r),
5454
Padding(
55-
padding: EdgeInsets.only(left: 16.w, top: 24.h),
55+
padding: EdgeInsets.only(left: 16.r, top: 24.r),
5656
child: Text(
5757
'Number of question solved',
5858
style: AppStyles.h1.copyWith(fontSize: 15.sp),
5959
),
6060
),
6161
const QuestionSolved(),
6262
Padding(
63-
padding: EdgeInsets.only(left: 16.w, top: 24.h),
63+
padding: EdgeInsets.only(left: 16.r, top: 24.r),
6464
child: Text(
6565
'Status of total Submissions',
6666
style: AppStyles.h1.copyWith(fontSize: 15.sp),

0 commit comments

Comments
 (0)