Skip to content

Commit

Permalink
Merge branch 'main' into casper/reset_password
Browse files Browse the repository at this point in the history
  • Loading branch information
am-casper committed Jan 11, 2024
2 parents 712c82b + 3584630 commit 1fd861a
Show file tree
Hide file tree
Showing 19 changed files with 397 additions and 369 deletions.
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
namespace "in.ac.iitr.mdg.appetizer"
compileSdkVersion 33
compileSdkVersion 34
ndkVersion flutter.ndkVersion

compileOptions {
Expand Down
5 changes: 2 additions & 3 deletions lib/presentation/components/app_formfield.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import 'package:google_fonts/google_fonts.dart';

class AppFormField extends StatelessWidget {
const AppFormField({
Key? key,
super.key,
required this.hintText,
this.controller,
this.onChanged,
Expand All @@ -23,8 +23,7 @@ class AppFormField extends StatelessWidget {
assert(
controller != null || onChanged != null,
'Either controller or onChanged should be provided',
),
super(key: key);
);

final String hintText;
final TextEditingController? controller;
Expand Down
5 changes: 2 additions & 3 deletions lib/presentation/components/app_textfield.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'package:google_fonts/google_fonts.dart';

class AppTextField extends StatelessWidget {
const AppTextField({
Key? key,
super.key,
required this.hintText,
this.controller,
this.onChanged,
Expand All @@ -20,8 +20,7 @@ class AppTextField extends StatelessWidget {
assert(
controller != null || onChanged != null,
'Either controller or onChanged should be provided',
),
super(key: key);
);

final String hintText;
final TextEditingController? controller;
Expand Down
8 changes: 4 additions & 4 deletions lib/presentation/components/black_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ class BlackButton extends StatelessWidget {
required this.title,
required this.onTap,
required this.width,
Key? key,
}) : super(key: key);
super.key,
});

final VoidCallback onTap;
final String title;
Expand Down Expand Up @@ -48,8 +48,8 @@ class BlackIconButton extends StatelessWidget {
required this.onTap,
required this.width,
required this.icon,
Key? key,
}) : super(key: key);
super.key,
});

final VoidCallback onTap;
final String title;
Expand Down
58 changes: 26 additions & 32 deletions lib/presentation/components/no_data_found_container.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,38 @@ import 'package:flutter/material.dart';
// import 'package:flutter_svg/flutter_svg.dart';

class NoDataFoundContainer extends StatelessWidget {
const NoDataFoundContainer({
required this.title,
Key? key,
}) : super(key: key);
const NoDataFoundContainer({required this.title, super.key});

final String title;

@override
Widget build(BuildContext context) {
return Container(
alignment: Alignment.center,
padding: EdgeInsets.only(top: 150.toAutoScaledHeight),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
// TODO: check why svg doesnt work
// SvgPicture.asset(
// 'assets/images/no_data_image.svg',
// // 'assets/images/no_data_image.svg',
// height: 178.toAutoScaledHeight,
// width: 186.toAutoScaledWidth,
// ),
Image.asset(
'assets/images/no_data_image.png',
height: 178.toAutoScaledHeight,
width: 186.toAutoScaledWidth,
return Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
// TODO: check why svg doesnt work
// SvgPicture.asset(
// 'assets/images/no_data_image.svg',
// // 'assets/images/no_data_image.svg',
// height: 178.toAutoScaledHeight,
// width: 186.toAutoScaledWidth,
// ),
Image.asset(
'assets/images/no_data_image.png',
height: 178.toAutoScaledHeight,
width: 186.toAutoScaledWidth,
),
Text(
title,
style: TextStyle(
color: const Color(0xFF111111),
fontSize: 18.toAutoScaledFont,
fontFamily: 'Noto Sans',
fontWeight: FontWeight.w400,
),
Text(
title,
style: TextStyle(
color: const Color(0xFF111111),
fontSize: 18.toAutoScaledFont,
fontFamily: 'Noto Sans',
fontWeight: FontWeight.w400,
),
),
],
),
),
],
);
}
}
5 changes: 1 addition & 4 deletions lib/presentation/coupons/components/coupon_row.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ import 'package:appetizer/presentation/coupons/components/coupon_card.dart';
import 'package:flutter/material.dart';

class CouponRow extends StatelessWidget {
const CouponRow({
required this.coupons,
Key? key,
}) : super(key: key);
const CouponRow({required this.coupons, super.key});

final List<Coupon> coupons;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class FeedbackTile extends StatelessWidget {
required this.title,
required this.parentState,
required this.index,
Key? key,
}) : super(key: key);
super.key,
});

final String title;
final FeedbackPageState parentState;
Expand Down
108 changes: 56 additions & 52 deletions lib/presentation/leaves_and_rebate/components/leave_history.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,70 +14,74 @@ class LeaveHistory extends StatelessWidget {
return Container(
margin: const EdgeInsets.symmetric(horizontal: 24),
decoration: ShapeDecoration(
color: AppTheme.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(15),
),
shadows: [
BoxShadow(
color: const Color(0x19000000),
blurRadius: 7.toAutoScaledWidth,
offset: const Offset(2, 2),
spreadRadius: 1,
)
]),
color: AppTheme.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(15),
),
shadows: [
BoxShadow(
color: const Color(0x19000000),
blurRadius: 7.toAutoScaledWidth,
offset: const Offset(2, 2),
spreadRadius: 1,
)
],
),
child: SingleChildScrollView(
child: ExpansionTile(
expandedCrossAxisAlignment: CrossAxisAlignment.start,
backgroundColor: AppTheme.white,
title: const SizedBox.shrink(),
leading: Text("Leave History",
style: AppTheme.headline3.copyWith(
fontSize: 16.toAutoScaledFont,
color: AppTheme.grey2f,
height: (11.0 / 8.0).toAutoScaledHeight)),
leading: Text(
"Leave History",
style: AppTheme.headline3.copyWith(
fontSize: 16.toAutoScaledFont,
color: AppTheme.grey2f,
height: (11.0 / 8.0).toAutoScaledHeight,
),
),
trailing: const Icon(Icons.expand_more, color: AppTheme.grey2f),
children: [
if (paginatedLeaves.results.isNotEmpty)
Container(
margin: EdgeInsets.only(left: 24.toAutoScaledWidth),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
paginatedLeaves.results[0].startDatetime.year
.toString(),
style: AppTheme.headline2.copyWith(
fontSize: 14.toAutoScaledFont,
color: AppTheme.primary),
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
paginatedLeaves.results[0].startDatetime.year.toString(),
style: AppTheme.headline2.copyWith(
fontSize: 14.toAutoScaledFont,
color: AppTheme.primary),
),
10.toVerticalSizedBox,
...paginatedLeaves.results.map(
(leave) => Padding(
padding: EdgeInsets.only(bottom: 10.toAutoScaledHeight),
child: Row(
children: [
RichText(
text: TextSpan(
text: DateFormat('dd MMM -')
.format(leave.startDatetime),
style: AppTheme.bodyText1
.copyWith(height: 1.toAutoScaledHeight),
children: [
TextSpan(
text: leave.startMealType,
style: const TextStyle(
color: AppTheme.primary),
)
],
),
),
// const Text("-"),
],
),
),
10.toVerticalSizedBox,
...paginatedLeaves.results
.map((leave) => Padding(
padding: EdgeInsets.only(
bottom: 10.toAutoScaledHeight),
child: Row(
children: [
RichText(
text: TextSpan(
text: DateFormat('dd MMM -')
.format(leave.startDatetime),
style: AppTheme.bodyText1.copyWith(
height: 1.toAutoScaledHeight),
children: [
TextSpan(
text: leave.startMealType,
style: const TextStyle(
color: AppTheme.primary),
)
]),
),
// const Text("-"),
],
),
))
.toList(),
]),
),
],
),
)
],
),
Expand Down
12 changes: 6 additions & 6 deletions lib/presentation/login/components/oauth_webview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'package:auto_route/auto_route.dart';
@RoutePage<String>()
class OAuthWebScreen extends StatelessWidget {
static const id = 'oauth_view';
OAuthWebScreen({Key? key}) : super(key: key);
OAuthWebScreen({super.key});
final ValueNotifier<int> _loadingState = ValueNotifier(1);

@override
Expand All @@ -21,13 +21,13 @@ class OAuthWebScreen extends StatelessWidget {
children: [
InAppWebView(
initialUrlRequest: URLRequest(
url: Uri.parse(AppConstants.omniportSignUpURL),
),
initialOptions: InAppWebViewGroupOptions(
crossPlatform: InAppWebViewOptions(
useShouldOverrideUrlLoading: true,
url: WebUri.uri(
Uri.parse(AppConstants.omniportSignUpURL),
),
),
initialSettings: InAppWebViewSettings(
useShouldOverrideUrlLoading: true,
),
onLoadStop: (_, uri) {
_loadingState.value = 0;
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ class NoNotificationsWidget extends StatelessWidget {

@override
Widget build(BuildContext context) {
return Container(
alignment: Alignment.center,
padding: EdgeInsets.only(top: 282.toAutoScaledHeight),
return Align(
child: Text(
'No new notifications !',
style: TextStyle(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ import 'package:flutter/material.dart';
import 'package:appetizer/domain/models/user/notification.dart' as notification;

class NotificationCard extends StatelessWidget {
const NotificationCard({
required this.data,
Key? key,
}) : super(key: key);
const NotificationCard({required this.data, super.key});

final notification.Notification data;

Expand Down
Loading

0 comments on commit 1fd861a

Please sign in to comment.