diff --git a/lib/data/core/theme/dimensional/dimensional.dart b/lib/data/core/theme/dimensional/dimensional.dart index c73a9ce5..5aea9d90 100644 --- a/lib/data/core/theme/dimensional/dimensional.dart +++ b/lib/data/core/theme/dimensional/dimensional.dart @@ -7,7 +7,7 @@ abstract class DimensionalPolicies { DimensionalPolicies._(); static double get policyRatioForWidth { - const designWidth = 375.0; + const designWidth = 360.0; final deviceWidth = () { late double width; diff --git a/lib/presentation/components/app_banner.dart b/lib/presentation/components/app_banner.dart index 39d5ac65..1dc34c4a 100644 --- a/lib/presentation/components/app_banner.dart +++ b/lib/presentation/components/app_banner.dart @@ -1,6 +1,9 @@ +import 'package:appetizer/data/core/theme/dimensional/dimensional.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg_provider/flutter_svg_provider.dart'; +import 'dart:math' as math; + class AppBanner extends StatelessWidget { const AppBanner({super.key, required this.height, required this.child}); final double height; @@ -8,34 +11,39 @@ class AppBanner extends StatelessWidget { @override Widget build(BuildContext context) { - return Stack(children: [ - Container( - height: height + 12, - width: 360, - decoration: const BoxDecoration( - image: DecorationImage( - image: Svg('assets/images/banner.svg'), - fit: BoxFit.cover, + return Column( + children: [ + Container( + height: height + 12.toAutoScaledHeight, + width: double.maxFinite, + decoration: const BoxDecoration( + image: DecorationImage( + image: Svg('assets/images/banner.svg'), //path of image + fit: BoxFit.fitWidth, + )), + child: Padding( + padding: EdgeInsets.only( + top: math.max(32, MediaQuery.of(context).padding.top), + bottom: 12), + child: child, ), ), - child: child, - ), - Positioned( - bottom: 0, - child: Container( - height: 12, - width: 360, - decoration: const ShapeDecoration( - color: Colors.white, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.only( - topLeft: Radius.circular(12), - topRight: Radius.circular(12), + Transform.translate( + offset: Offset(0, -12.toAutoScaledHeight), + child: Container( + height: 12.toAutoScaledHeight, + decoration: ShapeDecoration( + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(12.toAutoScaledWidth), + topRight: Radius.circular(12.toAutoScaledWidth), + ), ), ), ), - ), - ) - ]); + ) + ], + ); } } diff --git a/lib/presentation/components/black_button.dart b/lib/presentation/components/black_button.dart index 51696683..fe8051e0 100644 --- a/lib/presentation/components/black_button.dart +++ b/lib/presentation/components/black_button.dart @@ -1,3 +1,4 @@ +import 'package:appetizer/data/core/theme/dimensional/dimensional.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; @@ -16,12 +17,12 @@ class BlackButton extends StatelessWidget { @override Widget build(BuildContext context) { return Container( - height: 34, + height: 34.toAutoScaledHeight, width: width, decoration: ShapeDecoration( color: Colors.black, shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(6), + borderRadius: BorderRadius.circular(6.toAutoScaledWidth), ), ), child: TextButton( @@ -29,12 +30,12 @@ class BlackButton extends StatelessWidget { child: Text( title, textAlign: TextAlign.center, - style: const TextStyle( + style: TextStyle( color: Color(0xFFF6F6F6), - fontSize: 12, + fontSize: 12.toAutoScaledFont, fontFamily: 'Lato', fontWeight: FontWeight.w700, - height: 1.50, + height: 1.50.toAutoScaledHeight, ), ), ), diff --git a/lib/presentation/components/no_data_found_container.dart b/lib/presentation/components/no_data_found_container.dart index 5f557cd5..00b2d92c 100644 --- a/lib/presentation/components/no_data_found_container.dart +++ b/lib/presentation/components/no_data_found_container.dart @@ -1,4 +1,6 @@ +import 'package:appetizer/data/core/theme/dimensional/dimensional.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg_provider/flutter_svg_provider.dart'; class NoDataFoundContainer extends StatelessWidget { @@ -13,25 +15,20 @@ class NoDataFoundContainer extends StatelessWidget { Widget build(BuildContext context) { return Container( alignment: Alignment.center, - padding: const EdgeInsets.only(top: 150), + padding: EdgeInsets.only(top: 150.toAutoScaledHeight), child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ - Container( - padding: const EdgeInsets.only(top: 150), - height: 178, - width: 186, - decoration: const BoxDecoration( - image: DecorationImage( - image: Svg('assets/images/no_data_image.svg'), - ), - ), + SizedBox(height: 150.toAutoScaledHeight), + SvgPicture.asset( + 'assets/images/no_data_image.svg', + width: 186.toAutoScaledWidth, ), Text( title, - style: const TextStyle( - color: Color(0xFF111111), - fontSize: 18, + style: TextStyle( + color: const Color(0xFF111111), + fontSize: 18.toAutoScaledFont, fontFamily: 'Noto Sans', fontWeight: FontWeight.w400, ), diff --git a/lib/presentation/components/round_edge_container.dart b/lib/presentation/components/round_edge_container.dart index b199516a..6ed51883 100644 --- a/lib/presentation/components/round_edge_container.dart +++ b/lib/presentation/components/round_edge_container.dart @@ -1,6 +1,7 @@ // Wrap this widget in a GestureDetector and you are good to go! import 'package:appetizer/app_theme.dart'; +import 'package:appetizer/data/core/theme/dimensional/dimensional.dart'; import 'package:flutter/material.dart'; class RoundEdgeContainers extends StatelessWidget { @@ -10,11 +11,13 @@ class RoundEdgeContainers extends StatelessWidget { @override Widget build(BuildContext context) { return Container( - height: 34, - padding: const EdgeInsets.symmetric(horizontal: 25, vertical: 8), + height: 34.toAutoScaledHeight, + padding: EdgeInsets.symmetric( + horizontal: 25.toAutoScaledWidth, vertical: 8.toAutoScaledHeight), decoration: ShapeDecoration( color: AppTheme.black11, - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(6)), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(6.toAutoScaledWidth)), ), child: Row( mainAxisSize: MainAxisSize.min, @@ -33,7 +36,7 @@ class RoundEdgeTextOnlyContainer extends StatelessWidget { return RoundEdgeContainers( children: [ Padding( - padding: const EdgeInsets.symmetric(horizontal: 8.0), + padding: EdgeInsets.symmetric(horizontal: 8.0.toAutoScaledWidth), child: Text( text, style: AppTheme.button, diff --git a/lib/presentation/components/shadow_container.dart b/lib/presentation/components/shadow_container.dart index bea5db18..0566edb9 100644 --- a/lib/presentation/components/shadow_container.dart +++ b/lib/presentation/components/shadow_container.dart @@ -1,4 +1,5 @@ import 'package:appetizer/app_theme.dart'; +import 'package:appetizer/data/core/theme/dimensional/dimensional.dart'; import 'package:flutter/material.dart'; class ShadowContainer extends StatelessWidget { @@ -23,14 +24,14 @@ class ShadowContainer extends StatelessWidget { decoration: ShapeDecoration( color: Colors.white, shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10), + borderRadius: BorderRadius.circular(10.toAutoScaledWidth), ), shadows: [ BoxShadow( color: AppTheme.shadowColor, - blurRadius: 12, + blurRadius: 12.toAutoScaledWidth, offset: Offset(offset, offset), - spreadRadius: 1, + spreadRadius: 1.toAutoScaledWidth, ) ], ), diff --git a/lib/presentation/coupons/components/coupon_card.dart b/lib/presentation/coupons/components/coupon_card.dart index 4b08297e..8e2985ad 100644 --- a/lib/presentation/coupons/components/coupon_card.dart +++ b/lib/presentation/coupons/components/coupon_card.dart @@ -1,3 +1,4 @@ +import 'package:appetizer/data/core/theme/dimensional/dimensional.dart'; import 'package:appetizer/domain/models/coupon/coupon.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; @@ -12,71 +13,65 @@ class CouponCard extends StatelessWidget { @override Widget build(BuildContext context) { - return Container( - width: 129, - height: 61, - constraints: const BoxConstraints(maxHeight: 61), - child: Row( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - decoration: const BoxDecoration( - color: Color.fromARGB(255, 255, 255, 255), - ), - width: 28, - height: 61, - child: SvgPicture.asset('assets/images/coupon.svg'), + return Row( //TODO: test if parent widget required or not + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + decoration: const BoxDecoration( + color: Color.fromARGB(255, 255, 255, 255), ), - Container( - width: 101, - height: 61, - padding: const EdgeInsets.only( - top: 12, - left: 8, - right: 10, - bottom: 12, - ), - decoration: const ShapeDecoration( - color: Color.fromARGB(255, 255, 255, 255), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.only( - topLeft: Radius.zero, - topRight: Radius.circular(12), - bottomLeft: Radius.zero, - bottomRight: Radius.circular(12), - ), + width: 28.toAutoScaledWidth, + height: 61.toAutoScaledHeight, + child: SvgPicture.asset('assets/images/coupon.svg'), + ), + Container( + width: 101.toAutoScaledWidth, + height: 61.toAutoScaledHeight, + padding: EdgeInsets.only( + top: 12.toAutoScaledHeight, + left: 8.toAutoScaledWidth, + right: 10.toAutoScaledWidth, + bottom: 12.toAutoScaledHeight, + ), + decoration: ShapeDecoration( + color: Color.fromARGB(255, 255, 255, 255), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.only( + topLeft: Radius.zero, + topRight: Radius.circular(12.toAutoScaledWidth), + bottomLeft: Radius.zero, + bottomRight: Radius.circular(12.toAutoScaledWidth), ), ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - Text( - coupon.title, - textAlign: TextAlign.left, - style: const TextStyle( - color: Color(0xFF111111), - fontSize: 12, - fontFamily: 'Noto Sans', - fontWeight: FontWeight.w600, - ), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Text( + coupon.title, + textAlign: TextAlign.left, + style: TextStyle( + color: Color(0xFF111111), + fontSize: 12.toAutoScaledFont, + fontFamily: 'Noto Sans', + fontWeight: FontWeight.w600, ), - const SizedBox(height: 6), - Text( - coupon.meal, - style: const TextStyle( - color: Color(0xFF2E2E2E), - fontSize: 10, - fontFamily: 'Noto Sans', - fontWeight: FontWeight.w400, - ), + ), + SizedBox(height: 6.toAutoScaledHeight), + Text( + coupon.meal, + style: TextStyle( + color: Color(0xFF2E2E2E), + fontSize: 10.toAutoScaledFont, + fontFamily: 'Noto Sans', + fontWeight: FontWeight.w400, ), - ], - ), - ) - ], - ), + ), + ], + ), + ) + ], ); } } diff --git a/lib/presentation/coupons/coupons_view.dart b/lib/presentation/coupons/coupons_view.dart index 5e7dc4a6..fedf8e0a 100644 --- a/lib/presentation/coupons/coupons_view.dart +++ b/lib/presentation/coupons/coupons_view.dart @@ -1,3 +1,4 @@ +import 'package:appetizer/data/core/theme/dimensional/dimensional.dart'; import 'package:appetizer/presentation/components/no_data_found_container.dart'; import 'package:appetizer/presentation/coupons/bloc/coupons_page_bloc.dart'; import 'package:appetizer/presentation/coupons/components/coupon_card.dart'; @@ -15,17 +16,17 @@ class CouponsPage extends StatelessWidget { icon: const Icon(Icons.arrow_back), onPressed: () {}, ), - title: const Text( + title: Text( 'Coupons', style: TextStyle( color: Colors.white, - fontSize: 24, + fontSize: 24.toAutoScaledFont, fontFamily: 'Noto Sans', fontWeight: FontWeight.w700, ), ), backgroundColor: const Color(0xFFFFCB74), - toolbarHeight: 120, + toolbarHeight: 120.toAutoScaledHeight, ), body: BlocProvider( create: (context) => CouponsPageBloc(), @@ -47,11 +48,12 @@ class CouponsPage extends StatelessWidget { title: 'No coupons selected !'); } return Container( - padding: const EdgeInsets.only(left: 32, top: 40), + padding: EdgeInsets.only( + left: 32.toAutoScaledWidth, top: 40.toAutoScaledHeight), child: GridView.count( crossAxisCount: 2, - crossAxisSpacing: 39, - mainAxisSpacing: 27, + crossAxisSpacing: 39.toAutoScaledWidth, + mainAxisSpacing: 27.toAutoScaledHeight, children: List.generate( state.coupons.length, (index) => CouponCard(coupon: state.coupons[index]), diff --git a/lib/presentation/feedback/components/FeedbackTile/feedback_tile.dart b/lib/presentation/feedback/components/FeedbackTile/feedback_tile.dart index d518d2b6..9b4e01c4 100644 --- a/lib/presentation/feedback/components/FeedbackTile/feedback_tile.dart +++ b/lib/presentation/feedback/components/FeedbackTile/feedback_tile.dart @@ -1,3 +1,4 @@ +import 'package:appetizer/data/core/theme/dimensional/dimensional.dart'; import 'package:appetizer/presentation/feedback/bloc/feedback_page_bloc.dart'; import 'package:appetizer/presentation/feedback/components/FeedbackTile/bloc/feedback_tile_bloc.dart'; import 'package:flutter/material.dart'; @@ -24,9 +25,9 @@ class FeedbackTile extends StatelessWidget { Text( title, textAlign: TextAlign.left, - style: const TextStyle( + style: TextStyle( color: Color(0xFF111111), - fontSize: 20, + fontSize: 20.toAutoScaledFont, fontFamily: 'Lato', fontWeight: FontWeight.w400, ), @@ -39,7 +40,7 @@ class FeedbackTile extends StatelessWidget { mainAxisSize: MainAxisSize.min, children: List.generate(5, (index) { return IconButton( - iconSize: 27, + iconSize: 27.toAutoScaledWidth, onPressed: () { context.read().add( FeedbackRatingChangedEvent(newRating: index + 1)); diff --git a/lib/presentation/feedback/feedback_view.dart b/lib/presentation/feedback/feedback_view.dart index 173de7da..cfcc5c67 100644 --- a/lib/presentation/feedback/feedback_view.dart +++ b/lib/presentation/feedback/feedback_view.dart @@ -1,3 +1,4 @@ +import 'package:appetizer/data/core/theme/dimensional/dimensional.dart'; import 'package:appetizer/presentation/components/black_button.dart'; import 'package:appetizer/presentation/feedback/bloc/feedback_page_bloc.dart'; import 'package:appetizer/presentation/feedback/components/FeedbackTile/feedback_tile.dart'; @@ -7,6 +8,13 @@ import 'package:flutter_bloc/flutter_bloc.dart'; class FeedbackPage extends StatelessWidget { FeedbackPage({super.key}); final TextEditingController textController = TextEditingController(); + static const List feedbackHeadings = [ + "Ambience", + "Hygiene and Cleanliness", + "Weekly Menu", + "Worker and Services", + "Diet and Nutrition", + ]; @override Widget build(BuildContext context) { @@ -26,7 +34,7 @@ class FeedbackPage extends StatelessWidget { ), ), backgroundColor: const Color(0xFFFFCB74), - toolbarHeight: 120, + toolbarHeight: 120.toAutoScaledHeight, ), body: BlocProvider( create: (context) => FeedbackPageBloc(), @@ -42,42 +50,36 @@ class FeedbackPage extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - const SizedBox(height: 9), - const Text( - 'Kindly provide us with your feedback to improve your mess experience.', + SizedBox(height: 9.toAutoScaledHeight), + Text( + 'Kindly provide us with your feedback to improve your mess experienWeekly Menuce.', style: TextStyle( color: Color(0xFF5A5A5A), - fontSize: 14, + fontSize: 14.toAutoScaledFont, fontFamily: 'Lato', fontWeight: FontWeight.w400, ), ), - const SizedBox(height: 8), - FeedbackTile(title: 'Ambience', parentState: state, index: 0), - const SizedBox(height: 4), - FeedbackTile( - title: 'Hygiene and Cleanliness', - parentState: state, - index: 1), - const SizedBox(height: 4), - FeedbackTile( - title: 'Weekly Menu', parentState: state, index: 2), - const SizedBox(height: 4), - FeedbackTile( - title: 'Worker and Services', - parentState: state, - index: 3), - const SizedBox(height: 4), - FeedbackTile( - title: 'Diet and Nutrition', - parentState: state, - index: 4), - const SizedBox(height: 4), - const Text( + SizedBox(height: 6.toAutoScaledHeight), + ...List.generate(feedbackHeadings.length, (ind) { + return Padding( + padding: + EdgeInsets.symmetric(vertical: 2.toAutoScaledHeight), + child: FeedbackTile( + parentState: state, + title: feedbackHeadings[ind], + index: ind, + ), + ); + }), + SizedBox( + height: 2, + ), + Text( 'If any other feeback, please describe below', style: TextStyle( color: Color(0xFF111111), - fontSize: 16, + fontSize: 16.toAutoScaledFont, fontFamily: 'Lato', fontWeight: FontWeight.w400, ), @@ -86,7 +88,7 @@ class FeedbackPage extends StatelessWidget { 'Description', style: TextStyle( color: Colors.black.withOpacity(0.5400000214576721), - fontSize: 12, + fontSize: 12.toAutoScaledFont, fontFamily: 'Open Sans', fontWeight: FontWeight.w400, ), @@ -97,10 +99,10 @@ class FeedbackPage extends StatelessWidget { FeedbackPageDescriptionChangedEvent( description: value)), maxLength: 200, - decoration: const InputDecoration( + decoration: InputDecoration( border: OutlineInputBorder( borderSide: BorderSide( - width: 0.5, + width: 0.5.toAutoScaledWidth, color: Color.fromARGB(37, 0, 0, 0), ), ), diff --git a/lib/presentation/leaves_and_rebate/components/leave_history.dart b/lib/presentation/leaves_and_rebate/components/leave_history.dart index f6ff9405..800c5bc6 100644 --- a/lib/presentation/leaves_and_rebate/components/leave_history.dart +++ b/lib/presentation/leaves_and_rebate/components/leave_history.dart @@ -1,4 +1,5 @@ import 'package:appetizer/app_theme.dart'; +import 'package:appetizer/data/core/theme/dimensional/dimensional.dart'; import 'package:appetizer/domain/models/leaves/paginated_leaves.dart'; import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; @@ -17,10 +18,10 @@ class LeaveHistory extends StatelessWidget { shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(15), ), - shadows: const [ + shadows: [ BoxShadow( color: Color(0x19000000), - blurRadius: 7, + blurRadius: 7.toAutoScaledWidth, offset: Offset(2, 2), spreadRadius: 1, ) @@ -32,41 +33,44 @@ class LeaveHistory extends StatelessWidget { title: const SizedBox.shrink(), leading: Text("Leave History", style: AppTheme.headline3.copyWith( - fontSize: 16, color: AppTheme.grey2f, height: 11 / 8)), + fontSize: 16.toAutoScaledFont, + color: AppTheme.grey2f, + height: (11.0 / 8.0).toAutoScaledHeight)), trailing: const Icon(Icons.expand_more, color: AppTheme.grey2f), children: [ Container( - margin: const EdgeInsets.fromLTRB(24, 0, 0, 0), + 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, color: AppTheme.primary), + style: AppTheme.headline2.copyWith( + fontSize: 14.toAutoScaledFont, + color: AppTheme.primary), ), const SizedBox(height: 10), ...paginatedLeaves.results .map((leave) => Padding( - padding: const EdgeInsets.fromLTRB(0, 0, 0, 10), + 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), - ), - ), - const Text("-"), - RichText( - text: TextSpan( - text: leave.startMealType, - style: AppTheme.bodyText1.copyWith( - height: 1, color: AppTheme.primary), - ), + 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("-"), ], ), )) diff --git a/lib/presentation/leaves_and_rebate/components/monthly_rebates.dart b/lib/presentation/leaves_and_rebate/components/monthly_rebates.dart index 5fe66c82..a1b012c7 100644 --- a/lib/presentation/leaves_and_rebate/components/monthly_rebates.dart +++ b/lib/presentation/leaves_and_rebate/components/monthly_rebates.dart @@ -1,4 +1,5 @@ import 'package:appetizer/app_theme.dart'; +import 'package:appetizer/data/core/theme/dimensional/dimensional.dart'; import 'package:appetizer/domain/models/transaction/paginated_yearly_rebate.dart'; import 'package:appetizer/presentation/leaves_and_rebate/components/custom_divider.dart'; import 'package:appetizer/presentation/components/shadow_container.dart'; @@ -64,11 +65,12 @@ class _MonthlyRebatesState extends State { _monthlyRebateMap["All"] = _totalRebate; year = DateTime.now().year; return ShadowContainer( - height: 134, - width: 312, + height: 134.toAutoScaledHeight, + width: 312.toAutoScaledWidth, offset: 2, child: Padding( - padding: const EdgeInsets.fromLTRB(16, 16, 16, 20), + padding: EdgeInsets.fromLTRB(16.toAutoScaledWidth, + 16.toAutoScaledHeight, 16.toAutoScaledWidth, 20.toAutoScaledHeight), child: Column( mainAxisAlignment: MainAxisAlignment.start, children: [ @@ -79,13 +81,13 @@ class _MonthlyRebatesState extends State { "Monthly Rebates", style: AppTheme.headline3.copyWith( color: AppTheme.black1e, - fontSize: 20, + fontSize: 20.toAutoScaledFont, fontWeight: FontWeight.w400, ), ), Container( - width: 87, - height: 24, + width: 87.toAutoScaledWidth, + height: 24.toAutoScaledHeight, decoration: ShapeDecoration( color: AppTheme.primary, shape: RoundedRectangleBorder( @@ -135,26 +137,28 @@ class _MonthlyRebatesState extends State { ) ], ), - const SizedBox(height: 16), + SizedBox(height: 16.toAutoScaledHeight), Padding( - padding: const EdgeInsets.symmetric(horizontal: 3), + padding: EdgeInsets.symmetric(horizontal: 3.toAutoScaledWidth), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text("Rebates", - style: AppTheme.headline2 - .copyWith(color: AppTheme.primary, fontSize: 14)), + style: AppTheme.headline2.copyWith( + color: AppTheme.primary, + fontSize: 14.toAutoScaledFont)), Text("- Rs. ${_monthlyRebateMap[_currMonthName] ?? 0}", - style: AppTheme.headline2 - .copyWith(color: AppTheme.primary, fontSize: 14)) + style: AppTheme.headline2.copyWith( + color: AppTheme.primary, + fontSize: 14.toAutoScaledFont)) ], ), ), - const SizedBox(height: 16), + SizedBox(height: 16.toAutoScaledHeight), const CustomDivider(), - const SizedBox(height: 8), + SizedBox(height: 8.toAutoScaledHeight), Padding( - padding: const EdgeInsets.symmetric(horizontal: 8), + padding: EdgeInsets.symmetric(horizontal: 8.toAutoScaledWidth), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ diff --git a/lib/presentation/leaves_and_rebate/leaves_and_rebate.dart b/lib/presentation/leaves_and_rebate/leaves_and_rebate.dart index 3794135a..489714dc 100644 --- a/lib/presentation/leaves_and_rebate/leaves_and_rebate.dart +++ b/lib/presentation/leaves_and_rebate/leaves_and_rebate.dart @@ -1,4 +1,5 @@ import 'package:appetizer/app_theme.dart'; +import 'package:appetizer/data/core/theme/dimensional/dimensional.dart'; import 'package:appetizer/domain/models/leaves/paginated_leaves.dart'; import 'package:appetizer/domain/models/transaction/paginated_yearly_rebate.dart'; import 'package:appetizer/presentation/leaves_and_rebate/bloc/leaves_and_rebate_bloc.dart'; @@ -10,6 +11,8 @@ import 'package:appetizer/presentation/components/round_edge_container.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; +import 'dart:math' as math; + class LeavesAndRebate extends StatelessWidget { const LeavesAndRebate( {super.key, @@ -36,9 +39,13 @@ class LeavesAndRebate extends StatelessWidget { return Column( children: [ AppBanner( - height: 85, + height: 85.toAutoScaledHeight, child: Padding( - padding: const EdgeInsets.fromLTRB(24, 32, 0, 0), + padding: EdgeInsets.only( + left: 24.toAutoScaledWidth, + top: math.max(32.toAutoScaledHeight, + MediaQuery.of(context).padding.top), + ), child: Text( "Leaves & Rebates", style: AppTheme.headline1, @@ -47,17 +54,19 @@ class LeavesAndRebate extends StatelessWidget { ...[ if (state.isCheckedOut) Padding( - padding: const EdgeInsets.fromLTRB(0, 14, 0, 14), + padding: EdgeInsets.symmetric( + vertical: 14.toAutoScaledHeight, + ), child: Text( "You are currently checked-out", style: AppTheme.bodyText1.copyWith( fontFamily: 'Noto Sans', - fontSize: 14, + fontSize: 14.toAutoScaledFont, color: AppTheme.customRed), ), ), Padding( - padding: const EdgeInsets.fromLTRB(0, 0, 0, 14), + padding: EdgeInsets.only(bottom: 14.toAutoScaledHeight), child: GestureDetector( onTap: () { //TODO: add check in functionality @@ -66,44 +75,49 @@ class LeavesAndRebate extends StatelessWidget { ), ) ], - const SizedBox(height: 40), + SizedBox(height: 40.toAutoScaledHeight), MonthlyRebates( paginatedYearlyRebate: initialYearlyRebates, currMonthIndex: DateTime.now().month - 1), - const SizedBox(height: 24), + SizedBox(height: 24.toAutoScaledHeight), Padding( - padding: const EdgeInsets.fromLTRB(40, 0, 40, 0), + padding: + EdgeInsets.symmetric(horizontal: 40.toAutoScaledWidth), child: Column( children: [ Row( children: [ Text("Remaining Leaves : ", style: AppTheme.subtitle1.copyWith( - fontSize: 14, color: AppTheme.black2e)), + fontSize: 14.toAutoScaledFont, + color: AppTheme.black2e)), Text(state.remainingLeaves.toString(), style: AppTheme.headline2.copyWith( - fontSize: 14, color: AppTheme.primary)) + fontSize: 14.toAutoScaledFont, + color: AppTheme.primary)) ], ), - const SizedBox(height: 12), + SizedBox(height: 12.toAutoScaledHeight), Row( children: [ Text("Meals Skipped : ", style: AppTheme.subtitle1.copyWith( - fontSize: 14, color: AppTheme.black2e)), + fontSize: 14.toAutoScaledFont, + color: AppTheme.black2e)), Text(state.mealsSkipped.toString(), style: AppTheme.headline2.copyWith( - fontSize: 14, color: AppTheme.primary)) + fontSize: 14.toAutoScaledFont, + color: AppTheme.primary)) ], ), - const SizedBox(height: 20), + SizedBox(height: 20.toAutoScaledHeight), const CustomDivider(), ], ), ), - const SizedBox(height: 24), + SizedBox(height: 24.toAutoScaledHeight), LeaveHistory(paginatedLeaves: state.paginatedLeaves), - const SizedBox(height: 32), + SizedBox(height: 32.toAutoScaledHeight), if (!state.isCheckedOut) GestureDetector( child: diff --git a/lib/presentation/login/components/login_button.dart b/lib/presentation/login/components/login_button.dart index 4caf0863..925c884c 100644 --- a/lib/presentation/login/components/login_button.dart +++ b/lib/presentation/login/components/login_button.dart @@ -1,3 +1,4 @@ +import 'package:appetizer/data/core/theme/dimensional/dimensional.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; @@ -14,7 +15,7 @@ class _LoginButtonState extends State { @override Widget build(BuildContext context) { return MaterialButton( - minWidth: 110, + minWidth: 110.toAutoScaledWidth, elevation: 2.5, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(5), @@ -24,7 +25,7 @@ class _LoginButtonState extends State { child: Text( widget.text, style: GoogleFonts.lato( - fontSize: 14, + fontSize: 14.toAutoScaledFont, fontWeight: FontWeight.w600, ), ), diff --git a/lib/presentation/login/login_screen.dart b/lib/presentation/login/login_screen.dart index 48c44cbb..6fa84eba 100644 --- a/lib/presentation/login/login_screen.dart +++ b/lib/presentation/login/login_screen.dart @@ -1,3 +1,4 @@ +import 'package:appetizer/data/core/theme/dimensional/dimensional.dart'; import 'package:appetizer/presentation/login/components/login_button.dart'; import 'package:appetizer/presentation/login/bloc/login_bloc.dart'; import 'package:flutter/material.dart'; @@ -24,19 +25,20 @@ class _LoginScreenState extends State { child: Column( children: [ SvgPicture.asset('assets/images/login.svg'), - const SizedBox(height: 20), + SizedBox(height: 20.toAutoScaledHeight), Container( - width: 168, - height: 63, + width: 168.toAutoScaledWidth, + height: 63.toAutoScaledHeight, alignment: Alignment.center, child: SvgPicture.asset( 'assets/images/logo.png', // scale: 1.5, ), ), - const SizedBox(height: 30), + SizedBox(height: 30.toAutoScaledHeight), Padding( - padding: const EdgeInsets.symmetric(horizontal: 25), + padding: + EdgeInsets.symmetric(horizontal: 25.toAutoScaledWidth), child: BlocConsumer( listener: (context, state) { if (state is EnterPassword) { @@ -54,11 +56,11 @@ class _LoginScreenState extends State { Text( 'Set Password', style: GoogleFonts.notoSans( - fontSize: 18, + fontSize: 18.toAutoScaledFont, fontWeight: FontWeight.w600, ), ), - const SizedBox(height: 20), + SizedBox(height: 20.toAutoScaledHeight), TextField( controller: _controller, decoration: InputDecoration( @@ -74,18 +76,18 @@ class _LoginScreenState extends State { .withOpacity(0.25)), borderRadius: BorderRadius.circular(5), ), - contentPadding: - const EdgeInsets.symmetric(horizontal: 20), + contentPadding: EdgeInsets.symmetric( + horizontal: 20.toAutoScaledWidth), ), ), - const SizedBox(height: 10), + SizedBox(height: 10.toAutoScaledHeight), TextField( controller: _controller, obscureText: true, decoration: InputDecoration( hintText: 'Confirm Password', hintStyle: GoogleFonts.lato( - fontSize: 12, + fontSize: 12.toAutoScaledFont, color: const Color(0xFF111111), fontWeight: FontWeight.w600, ), @@ -100,11 +102,11 @@ class _LoginScreenState extends State { ), ), SizedBox( - height: 30, + height: 30.toAutoScaledHeight, child: Text( state.error ?? '', style: GoogleFonts.lato( - fontSize: 10, + fontSize: 10.toAutoScaledFont, color: const Color(0xFF2F2F2F), fontWeight: FontWeight.w400, ), @@ -133,7 +135,7 @@ class _LoginScreenState extends State { fontWeight: FontWeight.w600, ), ), - const SizedBox(height: 20), + SizedBox(height: 20.toAutoScaledHeight), TextField( controller: _controller, obscureText: state is EnterPassword @@ -144,7 +146,7 @@ class _LoginScreenState extends State { ? "Password" : 'Enrollment No.', hintStyle: GoogleFonts.lato( - fontSize: 12, + fontSize: 12.toAutoScaledFont, color: const Color(0xFF111111), fontWeight: FontWeight.w600, ), @@ -167,13 +169,13 @@ class _LoginScreenState extends State { .withOpacity(0.25)), borderRadius: BorderRadius.circular(5), ), - contentPadding: - const EdgeInsets.symmetric(horizontal: 20), + contentPadding: EdgeInsets.symmetric( + horizontal: 20.toAutoScaledWidth), ), ), state is EnterPassword ? SizedBox( - height: 30, + height: 30.toAutoScaledHeight, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -181,7 +183,7 @@ class _LoginScreenState extends State { Text( state.error ?? '', style: GoogleFonts.lato( - fontSize: 10, + fontSize: 10.toAutoScaledFont, color: const Color(0xFF2F2F2F), fontWeight: FontWeight.w400, ), @@ -191,7 +193,7 @@ class _LoginScreenState extends State { child: Text( 'Forgot Password?', style: GoogleFonts.lato( - fontSize: 10, + fontSize: 10.toAutoScaledFont, color: const Color(0xFF2F2F2F), fontWeight: FontWeight.w400, textStyle: const TextStyle( @@ -204,7 +206,7 @@ class _LoginScreenState extends State { ], ), ) - : const SizedBox(height: 20), + : SizedBox(height: 20.toAutoScaledHeight), Center( child: LoginButton( text: @@ -230,7 +232,7 @@ class _LoginScreenState extends State { child: Text( 'Raise a Query', style: GoogleFonts.inter( - fontSize: 12, + fontSize: 12.toAutoScaledFont, color: const Color(0xFF008BFF), fontWeight: FontWeight.w400, textStyle: const TextStyle( diff --git a/lib/presentation/notifications/components/no_notification_widget.dart b/lib/presentation/notifications/components/no_notification_widget.dart index 2c0987db..0d2da142 100644 --- a/lib/presentation/notifications/components/no_notification_widget.dart +++ b/lib/presentation/notifications/components/no_notification_widget.dart @@ -1,3 +1,4 @@ +import 'package:appetizer/data/core/theme/dimensional/dimensional.dart'; import 'package:flutter/material.dart'; class NoNotificationsWidget extends StatelessWidget { @@ -7,12 +8,12 @@ class NoNotificationsWidget extends StatelessWidget { Widget build(BuildContext context) { return Container( alignment: Alignment.center, - padding: const EdgeInsets.only(top: 282), - child: const Text( + padding: EdgeInsets.only(top: 282.toAutoScaledHeight), + child: Text( 'No new notifications !', style: TextStyle( color: Color(0xFF111111), - fontSize: 18, + fontSize: 18.toAutoScaledFont, fontFamily: 'Noto Sans', fontWeight: FontWeight.w400, ), diff --git a/lib/presentation/notifications/components/notification_card.dart b/lib/presentation/notifications/components/notification_card.dart index d0d7618a..f856bd55 100644 --- a/lib/presentation/notifications/components/notification_card.dart +++ b/lib/presentation/notifications/components/notification_card.dart @@ -1,3 +1,4 @@ +import 'package:appetizer/data/core/theme/dimensional/dimensional.dart'; import 'package:flutter/material.dart'; import 'package:appetizer/domain/models/user/notification.dart' as notification; @@ -12,18 +13,18 @@ class NotificationCard extends StatelessWidget { @override Widget build(BuildContext context) { return Container( - height: 127, - width: 312, - padding: const EdgeInsets.only( - top: 15, - left: 19, - right: 16, - bottom: 15, + height: 127.toAutoScaledHeight, + width: 312.toAutoScaledWidth, + padding: EdgeInsets.only( + top: 15.toAutoScaledHeight, + left: 19.toAutoScaledWidth, + right: 16.toAutoScaledWidth, + bottom: 15.toAutoScaledHeight, ), decoration: ShapeDecoration( color: Colors.white, shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.71), + borderRadius: BorderRadius.circular(10.71.toAutoScaledWidth), ), shadows: const [ BoxShadow( @@ -44,9 +45,9 @@ class NotificationCard extends StatelessWidget { Expanded( child: Text( data.title, - style: const TextStyle( + style: TextStyle( color: Color(0xFF111111), - fontSize: 18, + fontSize: 18.toAutoScaledFont, fontFamily: 'Noto Sans', fontWeight: FontWeight.w500, ), @@ -56,9 +57,9 @@ class NotificationCard extends StatelessWidget { Expanded( child: Text( '${data.dateCreated}', - style: const TextStyle( + style: TextStyle( color: Color(0xFF2E2E2E), - fontSize: 10, + fontSize: 10.toAutoScaledFont, fontFamily: 'Lato', fontWeight: FontWeight.w400, ), @@ -67,14 +68,14 @@ class NotificationCard extends StatelessWidget { ), ], ), - const SizedBox( - height: 4, + SizedBox( + height: 4.toAutoScaledHeight, ), Text( data.message, - style: const TextStyle( + style: TextStyle( color: Color(0xFF2E2E2E), - fontSize: 14, + fontSize: 14.toAutoScaledFont, fontFamily: 'Lato', fontWeight: FontWeight.w400, ), diff --git a/lib/presentation/notifications/components/switch_bar.dart b/lib/presentation/notifications/components/switch_bar.dart index 7e0f5822..ed8b0c5e 100644 --- a/lib/presentation/notifications/components/switch_bar.dart +++ b/lib/presentation/notifications/components/switch_bar.dart @@ -1,3 +1,4 @@ +import 'package:appetizer/data/core/theme/dimensional/dimensional.dart'; import 'package:appetizer/presentation/notifications/bloc/notification_page_bloc.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -12,77 +13,73 @@ class SwitchBarWidget extends StatelessWidget { @override Widget build(BuildContext context) { - return SizedBox( - height: 35, - width: 361, - child: Row( - children: [ - SizedBox( - width: 180, - child: GestureDetector( - onTap: () => context - .read() - .add(const NotificationPageSwitchChangedEvent(option: 0)), - child: Column( - children: [ - const SizedBox(height: 2), - const SizedBox( - width: 180, - height: 31, - child: Text( - 'New', - textAlign: TextAlign.center, - style: TextStyle( - color: Colors.white, - fontSize: 20, - fontFamily: 'Lato', - fontWeight: FontWeight.w600, - ), + return Row( + children: [ + SizedBox( + width: 180.toAutoScaledWidth, + child: GestureDetector( + onTap: () => context + .read() + .add(const NotificationPageSwitchChangedEvent(option: 0)), + child: Column( + children: [ + SizedBox(height: 2.toAutoScaledHeight), + SizedBox( + width: 180.toAutoScaledWidth, + height: 31.toAutoScaledHeight, + child: Text( + 'New', + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.white, + fontSize: 20.toAutoScaledFont, + fontFamily: 'Lato', + fontWeight: FontWeight.w600, ), ), - Divider( - height: 2, - thickness: 2, - color: option == 0 ? Colors.black : Colors.transparent, - ), - ], - ), + ), + Divider( + height: 2, + thickness: 2, + color: option == 0 ? Colors.black : Colors.transparent, + ), + ], ), ), - SizedBox( - width: 181, - child: GestureDetector( - onTap: () => context - .read() - .add(const NotificationPageSwitchChangedEvent(option: 1)), - child: Column( - children: [ - const SizedBox(height: 2), - const SizedBox( - width: 181, - height: 31, - child: Text( - 'Previous', - textAlign: TextAlign.center, - style: TextStyle( - color: Colors.white, - fontSize: 20, - fontFamily: 'Lato', - fontWeight: FontWeight.w600, - ), + ), + SizedBox( + width: 181.toAutoScaledWidth, + child: GestureDetector( + onTap: () => context + .read() + .add(const NotificationPageSwitchChangedEvent(option: 1)), + child: Column( + children: [ + SizedBox(height: 2.toAutoScaledHeight), + SizedBox( + width: 181.toAutoScaledWidth, + height: 31.toAutoScaledHeight, + child: Text( + 'Previous', + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.white, + fontSize: 20.toAutoScaledFont, + fontFamily: 'Lato', + fontWeight: FontWeight.w600, ), ), - Divider( - height: 2, - thickness: 2, - color: option == 1 ? Colors.black : Colors.transparent, - ), - ], - ), + ), + Divider( + height: 2, + thickness: 2, + color: option == 1 ? Colors.black : Colors.transparent, + ), + ], ), ), - ], - ), + ), + ], ); } } diff --git a/lib/presentation/notifications/notification_view.dart b/lib/presentation/notifications/notification_view.dart index 47191d9c..378aea7b 100644 --- a/lib/presentation/notifications/notification_view.dart +++ b/lib/presentation/notifications/notification_view.dart @@ -1,3 +1,4 @@ +import 'package:appetizer/data/core/theme/dimensional/dimensional.dart'; import 'package:appetizer/presentation/notifications/bloc/notification_page_bloc.dart'; import 'package:appetizer/presentation/notifications/components/no_notification_widget.dart'; import 'package:appetizer/presentation/notifications/components/notification_card.dart'; @@ -16,17 +17,17 @@ class NotificationPage extends StatelessWidget { icon: const Icon(Icons.arrow_back), onPressed: () {}, ), - title: const Text( + title: Text( 'Notification', style: TextStyle( color: Colors.white, - fontSize: 24, + fontSize: 24.toAutoScaledFont, fontFamily: 'Noto Sans', fontWeight: FontWeight.w700, ), ), backgroundColor: const Color(0xFFFFCB74), - toolbarHeight: 120, + toolbarHeight: 120.toAutoScaledHeight, ), // TODO: implement Old/New notification bars and logic body: BlocProvider( @@ -51,9 +52,11 @@ class NotificationPage extends StatelessWidget { children: [ SwitchBarWidget(option: state.option), Container( - height: 656, - padding: - const EdgeInsets.only(left: 24, right: 25, top: 32), + height: 656.toAutoScaledHeight, + padding: EdgeInsets.only( + left: 24.toAutoScaledWidth, + right: 25.toAutoScaledWidth, + top: 32.toAutoScaledHeight), child: ListView.builder( itemCount: state.notifications.length, itemBuilder: (context, index) { @@ -63,8 +66,8 @@ class NotificationPage extends StatelessWidget { data: state.notifications[index], ), index < state.notifications.length - ? const SizedBox( - height: 16, + ? SizedBox( + height: 16.toAutoScaledHeight, ) : const SizedBox.shrink(), ], diff --git a/lib/presentation/profile/components/profile_button.dart b/lib/presentation/profile/components/profile_button.dart index e0c2951d..16232484 100644 --- a/lib/presentation/profile/components/profile_button.dart +++ b/lib/presentation/profile/components/profile_button.dart @@ -1,3 +1,4 @@ +import 'package:appetizer/data/core/theme/dimensional/dimensional.dart'; import 'package:flutter/material.dart'; class ProfileTextButton extends StatelessWidget { @@ -13,25 +14,26 @@ class ProfileTextButton extends StatelessWidget { return TextButton( onPressed: onPressed, child: Container( - width: 115, - height: 32, - padding: const EdgeInsets.symmetric(horizontal: 26, vertical: 6), + width: 115.toAutoScaledWidth, + height: 32.toAutoScaledHeight, + padding: EdgeInsets.symmetric( + horizontal: 26.toAutoScaledWidth, vertical: 6.toAutoScaledHeight), decoration: ShapeDecoration( color: Colors.white, shape: RoundedRectangleBorder( side: const BorderSide(width: 0.50, color: Color(0xFFBCBCBC)), - borderRadius: BorderRadius.circular(6), + borderRadius: BorderRadius.circular(6.toAutoScaledWidth), ), ), child: Text( title, textAlign: TextAlign.center, - style: const TextStyle( + style: TextStyle( color: Color(0xFF111111), - fontSize: 13, + fontSize: 13.toAutoScaledFont, fontFamily: 'Lato', fontWeight: FontWeight.w400, - height: 1.54, + height: 1.54.toAutoScaledHeight, ), ), ), @@ -54,9 +56,13 @@ class ProfileIconButton extends StatelessWidget { @override Widget build(BuildContext context) { return Container( - width: 121, - height: 36, - padding: const EdgeInsets.only(top: 4, left: 4, right: 8, bottom: 4), + width: 121.toAutoScaledWidth, + height: 36.toAutoScaledHeight, + padding: EdgeInsets.only( + top: 4.toAutoScaledHeight, + left: 4.toAutoScaledWidth, + right: 8.toAutoScaledWidth, + bottom: 4.toAutoScaledHeight), decoration: ShapeDecoration( color: Colors.white, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(6)), @@ -73,24 +79,24 @@ class ProfileIconButton extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: [ - const SizedBox( - width: 20, - height: 20, + SizedBox( + width: 20.toAutoScaledWidth, + height: 20.toAutoScaledHeight, child: Icon( Icons.bookmark_border_outlined, color: Color.fromARGB(255, 255, 203, 116), ), ), - const SizedBox(width: 10), + SizedBox(width: 10.toAutoScaledWidth), Text( title, textAlign: TextAlign.center, - style: const TextStyle( + style: TextStyle( color: Color(0xFF111111), - fontSize: 14, + fontSize: 14.toAutoScaledFont, fontFamily: 'Lato', fontWeight: FontWeight.w500, - height: 1.43, + height: 1.43.toAutoScaledHeight, ), ), ], diff --git a/lib/presentation/profile/components/profile_card.dart b/lib/presentation/profile/components/profile_card.dart index c7d6d927..1cb25794 100644 --- a/lib/presentation/profile/components/profile_card.dart +++ b/lib/presentation/profile/components/profile_card.dart @@ -1,3 +1,4 @@ +import 'package:appetizer/data/core/theme/dimensional/dimensional.dart'; import 'package:appetizer/domain/models/user/user.dart'; import 'package:flutter/material.dart'; @@ -17,18 +18,18 @@ class Fields extends StatelessWidget { children: [ Text( '$title ', - style: const TextStyle( + style: TextStyle( color: Color(0xFF111111), - fontSize: 16, + fontSize: 16.toAutoScaledFont, fontFamily: 'Lato', fontWeight: FontWeight.w500, ), ), Text( data, - style: const TextStyle( + style: TextStyle( color: Color(0xFF2E2E2E), - fontSize: 16, + fontSize: 16.toAutoScaledFont, fontFamily: 'Inter', fontWeight: FontWeight.w400, ), @@ -49,18 +50,18 @@ class ProfileCard extends StatelessWidget { @override Widget build(BuildContext context) { return Container( - width: 293, - height: 167, - padding: const EdgeInsets.only( - top: 20, - left: 20, - right: 37, - bottom: 20, + width: 293.toAutoScaledWidth, + height: 167.toAutoScaledHeight, + padding: EdgeInsets.only( + top: 20.toAutoScaledHeight, + left: 20.toAutoScaledWidth, + right: 37.toAutoScaledWidth, + bottom: 20.toAutoScaledHeight, ), decoration: ShapeDecoration( color: Colors.white, shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(20), + borderRadius: BorderRadius.circular(20.toAutoScaledWidth), ), shadows: const [ BoxShadow( @@ -77,29 +78,29 @@ class ProfileCard extends StatelessWidget { title: 'Enrollment No:', data: '${data.enrNo}', ), - const SizedBox( - height: 8, + SizedBox( + height: 8.toAutoScaledHeight, ), Fields( title: 'Hostel:', data: data.hostelName, ), - const SizedBox( - height: 8, + SizedBox( + height: 8.toAutoScaledHeight, ), Fields( title: 'Branch:', data: data.branch ?? "", ), - const SizedBox( - height: 8, + SizedBox( + height: 8.toAutoScaledHeight, ), Fields( title: 'Email:', data: data.email, ), - const SizedBox( - height: 8, + SizedBox( + height: 8.toAutoScaledHeight, ), Fields( title: 'Room No:', diff --git a/lib/presentation/profile/components/profile_photo.dart b/lib/presentation/profile/components/profile_photo.dart index eb4b38ad..52ebe3e3 100644 --- a/lib/presentation/profile/components/profile_photo.dart +++ b/lib/presentation/profile/components/profile_photo.dart @@ -1,3 +1,4 @@ +import 'package:appetizer/data/core/theme/dimensional/dimensional.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg_provider/flutter_svg_provider.dart'; @@ -12,18 +13,17 @@ class ProfilePhoto extends StatelessWidget { @override Widget build(BuildContext context) { return Container( - constraints: BoxConstraints.tight(const Size(124, 124)), decoration: ShapeDecoration( color: Colors.white, shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(62), - side: const BorderSide( + borderRadius: BorderRadius.circular(62.toAutoScaledWidth), + side: BorderSide( color: Color.fromARGB(255, 255, 255, 255), - width: 12.4, + width: 12.4.toAutoScaledWidth, )), ), - width: 124, - height: 124, + width: 124.toAutoScaledWidth, + height: 124.toAutoScaledHeight, child: const CircleAvatar( backgroundColor: Color.fromARGB(255, 255, 255, 255), foregroundImage: Svg( diff --git a/lib/presentation/profile/profile_view.dart b/lib/presentation/profile/profile_view.dart index f2fc3bef..5f2b2146 100644 --- a/lib/presentation/profile/profile_view.dart +++ b/lib/presentation/profile/profile_view.dart @@ -1,3 +1,4 @@ +import 'package:appetizer/data/core/theme/dimensional/dimensional.dart'; import 'package:appetizer/domain/models/user/user.dart'; import 'package:appetizer/presentation/components/black_button.dart'; import 'package:appetizer/presentation/profile/components/profile_button.dart'; @@ -20,19 +21,19 @@ class ProfilePage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - height: 200, + height: 200.toAutoScaledHeight, width: double.infinity, decoration: const BoxDecoration( color: Color(0xFFFFCB74), ), - padding: const EdgeInsets.only(left: 24), - child: const Align( + padding: EdgeInsets.only(left: 24.toAutoScaledWidth), + child: Align( alignment: Alignment.centerLeft, child: Text( 'My Profile', style: TextStyle( color: Colors.white, - fontSize: 24, + fontSize: 24.toAutoScaledWidth, fontFamily: 'Noto Sans', fontWeight: FontWeight.w700, ), @@ -48,28 +49,34 @@ class ProfilePage extends StatelessWidget { ), Text( data.name, - style: const TextStyle( + style: TextStyle( color: Color(0xFF111111), - fontSize: 25, + fontSize: 25.toAutoScaledFont, fontFamily: 'Noto Sans', fontWeight: FontWeight.w600, ), ), Container( - padding: const EdgeInsets.only(left: 33, right: 34, top: 22), + padding: EdgeInsets.only( + left: 33.toAutoScaledWidth, + right: 34.toAutoScaledWidth, + top: 22.toAutoScaledHeight), child: ProfileCard(data: data), ), Container( - padding: const EdgeInsets.only( - left: 55, right: 57, top: 24, bottom: 24), + padding: EdgeInsets.only( + left: 55.toAutoScaledWidth, + right: 57.toAutoScaledWidth, + top: 24.toAutoScaledHeight, + bottom: 24.toAutoScaledHeight), child: Row( children: [ ProfileTextButton( title: 'Edit Profile', onPressed: () {}, ), - const SizedBox( - width: 10, + SizedBox( + width: 10.toAutoScaledWidth, ), ProfileTextButton( title: 'Reset Password', @@ -78,7 +85,7 @@ class ProfilePage extends StatelessWidget { ], ), ), - const Divider( + Divider( height: 2, thickness: 2, color: Color.fromARGB(255, 189, 189, 189), @@ -86,7 +93,10 @@ class ProfilePage extends StatelessWidget { endIndent: 30, ), Container( - padding: const EdgeInsets.only(left: 46, right: 48, top: 24), + padding: EdgeInsets.only( + left: 46.toAutoScaledWidth, + right: 48.toAutoScaledWidth, + top: 24.toAutoScaledHeight), child: Row( children: [ ProfileIconButton( @@ -94,8 +104,8 @@ class ProfilePage extends StatelessWidget { onPressed: () {}, icon: Icons.bookmark_border_outlined, ), - const SizedBox( - width: 48, + SizedBox( + width: 48.toAutoScaledWidth, ), ProfileIconButton( title: 'Coupons', @@ -105,13 +115,13 @@ class ProfilePage extends StatelessWidget { ], ), ), - const SizedBox(height: 40), + SizedBox(height: 40.toAutoScaledHeight), BlackButton( title: 'LOGOUT', onTap: () {}, width: 101, ), - const SizedBox(height: 18), + SizedBox(height: 18.toAutoScaledHeight), TextButton( onPressed: () {}, style: TextButton.styleFrom( @@ -119,11 +129,11 @@ class ProfilePage extends StatelessWidget { minimumSize: Size.zero, tapTargetSize: MaterialTapTargetSize.shrinkWrap, ), - child: const Text( + child: Text( 'Raise a Query', style: TextStyle( color: Color(0xFF008BFF), - fontSize: 12, + fontSize: 12.toAutoScaledFont, fontFamily: 'Inter', fontWeight: FontWeight.w400, decoration: TextDecoration.underline, diff --git a/lib/presentation/week_menu/components/day_date_bar.dart b/lib/presentation/week_menu/components/day_date_bar.dart index 6fec0a84..4539c5a8 100644 --- a/lib/presentation/week_menu/components/day_date_bar.dart +++ b/lib/presentation/week_menu/components/day_date_bar.dart @@ -1,5 +1,6 @@ import 'package:appetizer/app_theme.dart'; import 'package:appetizer/data/constants/constants.dart'; +import 'package:appetizer/data/core/theme/dimensional/dimensional.dart'; import 'package:appetizer/presentation/week_menu/bloc/your_week_menu_bloc_bloc.dart'; import 'package:appetizer/presentation/week_menu/components/title_bar.dart'; import 'package:flutter/material.dart'; @@ -14,13 +15,14 @@ class _CurrDateWidget extends StatelessWidget { @override Widget build(BuildContext context) { return Container( - width: 33, - height: 53, - padding: const EdgeInsets.symmetric(horizontal: 5, vertical: 6), + width: 33.toAutoScaledWidth, + height: 53.toAutoScaledHeight, + padding: EdgeInsets.symmetric( + horizontal: 5.toAutoScaledWidth, vertical: 6.toAutoScaledHeight), decoration: ShapeDecoration( color: AppTheme.black2e, shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(16), + borderRadius: BorderRadius.circular(16.toAutoScaledWidth), ), ), child: Column( @@ -29,26 +31,26 @@ class _CurrDateWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ SizedBox( - height: 14, + height: 14.toAutoScaledHeight, child: Text( AppConstants.dayToInitial[day]!, - style: AppTheme.button.copyWith(height: 1), + style: AppTheme.button.copyWith(height: 1.toAutoScaledHeight), ), ), - const SizedBox(height: 2), + SizedBox(height: 2.toAutoScaledHeight), Container( decoration: ShapeDecoration( color: AppTheme.customWhite, shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(30), + borderRadius: BorderRadius.circular(30.toAutoScaledWidth), ), ), - height: 25, + height: 25.toAutoScaledHeight, child: Center( child: Text( date.toString(), - style: AppTheme.button - .copyWith(color: AppTheme.black1e, height: 1), + style: AppTheme.button.copyWith( + color: AppTheme.black1e, height: 1.toAutoScaledHeight), ), ), ), @@ -66,12 +68,13 @@ class _OtherDateWidget extends StatelessWidget { @override Widget build(BuildContext context) { return Container( - width: 33, - height: 53, - padding: const EdgeInsets.symmetric(horizontal: 5, vertical: 6), + width: 33.toAutoScaledWidth, + height: 53.toAutoScaledHeight, + padding: EdgeInsets.symmetric( + horizontal: 5.toAutoScaledWidth, vertical: 6.toAutoScaledHeight), decoration: ShapeDecoration( shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(16), + borderRadius: BorderRadius.circular(16.toAutoScaledWidth), ), ), child: Column( @@ -80,27 +83,27 @@ class _OtherDateWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ SizedBox( - height: 14, + height: 14.toAutoScaledHeight, child: Text( AppConstants.dayToInitial[day]!, - style: AppTheme.button.copyWith(height: 1), + style: AppTheme.button.copyWith(height: 1.toAutoScaledHeight), ), ), - const SizedBox(height: 2), + SizedBox(height: 2.toAutoScaledHeight), Container( // padding: const EdgeInsets.symmetric(vertical: 5.5, horizontal: 6), decoration: ShapeDecoration( color: AppTheme.customWhite, shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(30), + borderRadius: BorderRadius.circular(30.toAutoScaledWidth), ), ), - height: 25, + height: 25.toAutoScaledHeight, child: Center( child: Text( date.toString(), - style: AppTheme.button - .copyWith(color: AppTheme.black1e, height: 1), + style: AppTheme.button.copyWith( + color: AppTheme.black1e, height: 1.toAutoScaledHeight), ), ), ), @@ -144,22 +147,21 @@ class _NewDayDateBarState extends State { currDate = widget.currDate; dates = widget.dates; dateToMonthYear = widget.dateToMonthYear; - return SizedBox( - width: 360, - child: Column( - children: [ - ("${DateFormat("dd ").format(DateTime.now())}${DateFormat("MMM").format(DateTime.now())}'${DateFormat("yy").format(DateTime.now())}" == - ("$currDate ${dateToMonthYear![currDate]!}")) - ? TitleBar( - monthAndYear: dateToMonthYear![currDate]!, dayName: "Today") - : TitleBar( - monthAndYear: "", - dayName: ("$currDate ${dateToMonthYear![currDate]!}")), - Row( + return Column( + children: [ + (DateFormat("dd MMM'yy").format(DateTime.now()) == + ("$currDate ${dateToMonthYear![currDate]!}")) + ? TitleBar( + monthAndYear: dateToMonthYear![currDate]!, dayName: "Today") + : TitleBar( + monthAndYear: "", + dayName: ("$currDate ${dateToMonthYear![currDate]!}")), + Expanded( + child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisSize: MainAxisSize.min, children: [ - const SizedBox(width: 12.5), + SizedBox(width: 12.5.toAutoScaledWidth), GestureDetector( onTap: () { setState(() { @@ -178,7 +180,7 @@ class _NewDayDateBarState extends State { widgetDateOffset++) Row( children: [ - const SizedBox(width: 15), + SizedBox(width: 15.toAutoScaledWidth), GestureDetector( child: currDate == dates![widgetDateOffset] ? _CurrDateWidget( @@ -198,11 +200,11 @@ class _NewDayDateBarState extends State { ), ], ), - const SizedBox(width: 8.5), + SizedBox(width: 8.5.toAutoScaledWidth), ], ), - ], - ), + ), + ], ); } } diff --git a/lib/presentation/week_menu/components/title_bar.dart b/lib/presentation/week_menu/components/title_bar.dart index 93974cc7..78dd0952 100644 --- a/lib/presentation/week_menu/components/title_bar.dart +++ b/lib/presentation/week_menu/components/title_bar.dart @@ -1,4 +1,5 @@ import 'package:appetizer/app_theme.dart'; +import 'package:appetizer/data/core/theme/dimensional/dimensional.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; @@ -13,8 +14,8 @@ class TitleBar extends StatelessWidget { @override Widget build(BuildContext context) { return Container( - width: 360, - padding: const EdgeInsets.symmetric(horizontal: 24), + width: 360.toAutoScaledWidth, + padding: EdgeInsets.symmetric(horizontal: 24.toAutoScaledWidth), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -22,8 +23,8 @@ class TitleBar extends StatelessWidget { child: Row( children: [ Text(dayName, style: AppTheme.headline1), - const SizedBox( - width: 8, + SizedBox( + width: 8.toAutoScaledWidth, ), const VerticalDivider( thickness: 1.5, @@ -31,11 +32,11 @@ class TitleBar extends StatelessWidget { ), Text(monthAndYear, style: AppTheme.headline1.copyWith( - fontSize: 16, + fontSize: 16.toAutoScaledFont, fontWeight: FontWeight.w600, )), - const SizedBox( - width: 6, + SizedBox( + width: 6.toAutoScaledWidth, ), const Icon( Icons.calendar_today_outlined, diff --git a/lib/presentation/week_menu/components/yourMealDailyCardsCombined/menu_card.dart b/lib/presentation/week_menu/components/yourMealDailyCardsCombined/menu_card.dart index 0c8c2e5c..f7bdb48e 100644 --- a/lib/presentation/week_menu/components/yourMealDailyCardsCombined/menu_card.dart +++ b/lib/presentation/week_menu/components/yourMealDailyCardsCombined/menu_card.dart @@ -1,4 +1,5 @@ import 'package:appetizer/app_theme.dart'; +import 'package:appetizer/data/core/theme/dimensional/dimensional.dart'; import 'package:appetizer/domain/models/menu/week_menu.dart'; import 'package:appetizer/presentation/week_menu/components/yourMealDailyCardsCombined/bloc/your_meal_daily_cards_combined_bloc.dart'; import 'package:appetizer/presentation/components/shadow_container.dart'; @@ -30,9 +31,9 @@ class FeedbackAndCouponWidget extends StatelessWidget { Widget build(BuildContext context) { return Center( child: Container( - height: 24, - width: 88, - padding: const EdgeInsets.symmetric(horizontal: 8), + height: 24.toAutoScaledHeight, + width: 88.toAutoScaledWidth, + padding: EdgeInsets.symmetric(horizontal: 8.toAutoScaledWidth), decoration: ShapeDecoration( color: AppTheme.white, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(6)), @@ -45,8 +46,8 @@ class FeedbackAndCouponWidget extends StatelessWidget { ], Text(coupon ? "COUPON" : "Give Feedback", style: AppTheme.button.copyWith( - height: 1, - fontSize: 11, + height: 1.toAutoScaledHeight, + fontSize: 11.toAutoScaledFont, fontWeight: FontWeight.w600, color: AppTheme.black11)) ], @@ -72,21 +73,22 @@ class CouponDialogBox extends StatelessWidget { Widget build(BuildContext context) { return AlertDialog( content: Container( - width: 310, - height: 83, + width: 310.toAutoScaledWidth, + height: 83.toAutoScaledHeight, decoration: ShapeDecoration( color: Colors.amber, - shape: - RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.toAutoScaledWidth)), ), child: Stack( children: [ Padding( - padding: const EdgeInsets.symmetric(horizontal: 60), + padding: EdgeInsets.symmetric(horizontal: 60.toAutoScaledWidth), child: Center( child: Text(text, style: AppTheme.headline3.copyWith( - fontSize: 17, fontWeight: FontWeight.w400))), + fontSize: 17.toAutoScaledFont, + fontWeight: FontWeight.w400))), ), Positioned( right: 0, @@ -115,15 +117,15 @@ class MealCard extends StatelessWidget { dailyItemsParsed.substring(0, dailyItemsParsed.length - 2); return ShadowContainer( offset: 2, - width: 312, - height: 168, + width: 312.toAutoScaledWidth, + height: 168.toAutoScaledHeight, child: Container( child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - width: 125, - height: 168, + width: 125.toAutoScaledWidth, + height: 168.toAutoScaledHeight, decoration: BoxDecoration( image: DecorationImage( image: svg.Svg( @@ -135,33 +137,34 @@ class MealCard extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, children: [ - const SizedBox(height: 15), + SizedBox(height: 15.toAutoScaledHeight), Container( - height: 28, - padding: const EdgeInsets.only(left: 12), + height: 28.toAutoScaledHeight, + padding: EdgeInsets.only(left: 12), child: Text( meal.title, - style: AppTheme.headline1 - .copyWith(fontSize: 20, color: AppTheme.black11), + style: AppTheme.headline1.copyWith( + fontSize: 20.toAutoScaledFont, + color: AppTheme.black11), ), ), Container( - height: 17, - padding: const EdgeInsets.only(left: 12), + height: 17.toAutoScaledHeight, + padding: EdgeInsets.only(left: 12.toAutoScaledWidth), child: Text( '${DateFormat.jm().format(meal.startTime)} - ${DateFormat.jm().format(meal.endTime)}', style: AppTheme.headline3.copyWith( fontWeight: FontWeight.w600, - fontSize: 12, + fontSize: 12.toAutoScaledFont, color: AppTheme.grey2f), ), ), - const SizedBox(height: 9), + SizedBox(height: 9.toAutoScaledHeight), Row( mainAxisAlignment: MainAxisAlignment.start, children: [ Container( - padding: const EdgeInsets.only(left: 12), + padding: EdgeInsets.only(left: 12.toAutoScaledWidth), child: FittedBox( fit: BoxFit.contain, child: FSwitch( @@ -169,8 +172,8 @@ class MealCard extends StatelessWidget { open: meal.leaveStatus.status != LeaveStatusEnum.A, sliderColor: AppTheme.customWhite, openColor: AppTheme.black2e, - height: 20, - width: 44, + height: 20.toAutoScaledHeight, + width: 44.toAutoScaledWidth, onChanged: (value) async { context .read() @@ -185,7 +188,7 @@ class MealCard extends StatelessWidget { ), ], ), - const SizedBox(height: 45), + SizedBox(height: 45.toAutoScaledHeight), ...[ meal.isOutdated ? GestureDetector( @@ -229,7 +232,7 @@ class MealCard extends StatelessWidget { ) : const SizedBox.shrink()), ], - const SizedBox(height: 10) + SizedBox(height: 10.toAutoScaledHeight) ], ), ), @@ -238,20 +241,24 @@ class MealCard extends StatelessWidget { mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.start, children: [ - const SizedBox(height: 18), + SizedBox(height: 18.toAutoScaledHeight), for (var item in meal.items) Text(" \u2022 ${item.name}"), const Spacer(), Container( - margin: const EdgeInsets.fromLTRB(22, 0, 20, 0), + margin: EdgeInsets.symmetric( + horizontal: 22.toAutoScaledWidth, + ), height: 0.5, width: 145, color: AppTheme.rulerColor, ), - const SizedBox(height: 8), + SizedBox(height: 8.toAutoScaledHeight), Container( - width: 187, - padding: - const EdgeInsets.only(left: 12, right: 19, bottom: 0), + width: 187.toAutoScaledWidth, + padding: EdgeInsets.only( + left: 12.toAutoScaledWidth, + right: 19.toAutoScaledWidth, + ), child: RichText( text: TextSpan( text: 'Daily Items: ', @@ -265,7 +272,7 @@ class MealCard extends StatelessWidget { ), ), ), - const SizedBox(height: 17) + SizedBox(height: 17.toAutoScaledHeight) ], ) ], diff --git a/lib/presentation/week_menu/components/yourMealDailyCardsCombined/your_meal_daily_cards_combined.dart b/lib/presentation/week_menu/components/yourMealDailyCardsCombined/your_meal_daily_cards_combined.dart index b7558b78..7df9e240 100644 --- a/lib/presentation/week_menu/components/yourMealDailyCardsCombined/your_meal_daily_cards_combined.dart +++ b/lib/presentation/week_menu/components/yourMealDailyCardsCombined/your_meal_daily_cards_combined.dart @@ -1,6 +1,7 @@ // just combine three cards into one // pass just the daily meal to it +import 'package:appetizer/data/core/theme/dimensional/dimensional.dart'; import 'package:appetizer/domain/models/menu/week_menu.dart'; import 'package:appetizer/presentation/week_menu/components/yourMealDailyCardsCombined/menu_card.dart'; import 'package:appetizer/presentation/week_menu/components/yourMealDailyCardsCombined/bloc/your_meal_daily_cards_combined_bloc.dart'; @@ -31,8 +32,10 @@ class YourMealDailyCardsCombined extends StatelessWidget { children: dayMenu.meals .map( (meal) => Padding( - padding: EdgeInsets.fromLTRB( - 0, 0, 0, (meal == dayMenu.meals.last ? 0 : 24)), + padding: EdgeInsets.only( + bottom: (meal == dayMenu.meals.last ? 0 : 24) + .toAutoScaledHeight, + ), child: BlocSelector( selector: (state) => diff --git a/lib/presentation/week_menu/your_menu_view.dart b/lib/presentation/week_menu/your_menu_view.dart index a84248f7..346d1ad1 100644 --- a/lib/presentation/week_menu/your_menu_view.dart +++ b/lib/presentation/week_menu/your_menu_view.dart @@ -1,5 +1,6 @@ // import 'package:appetizer/AppConstants.dart'; import 'package:appetizer/app_theme.dart'; +import 'package:appetizer/data/core/theme/dimensional/dimensional.dart'; import 'package:appetizer/domain/models/menu/week_menu.dart'; import 'package:appetizer/presentation/week_menu/bloc/your_week_menu_bloc_bloc.dart'; import 'package:appetizer/presentation/week_menu/components/day_date_bar.dart'; @@ -71,119 +72,85 @@ class YourWeekMenu extends StatelessWidget { } if (state is YourWeekMenuBlocDisplayState) { return Column( - mainAxisSize: MainAxisSize.max, + mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Column( - children: [ - AppBanner( - height: 146, - child: Column( - children: [ - const SizedBox( - height: 32, - ), - GestureDetector( - onPanUpdate: ((details) { - // Swiping in right direction. - if (details.delta.dx > 0) { - // move to previous week - context.read().add( - PreviousWeekChangeEvent( - previousWeekId: - state.weekMenu.weekId - 1, - ), - ); - } - // Swiping in left direction. - if (details.delta.dx < 0) { - context.read().add( - NextWeekChangeEvent( - nextWeekId: state.weekMenu.weekId + 1, - ), - ); - } - }), - child: NewDayDateBar( - currDate: dates[state.currDayIndex], - dates: dates, - dateToMonthYear: dateToMonthYear, - blocObj: context.read(), - ), - ), - // YourMealDailyCardsCombined( - // dayMenu: - // weekMenu.dayMenus[state.currDayIndex], - // dailyItems: weekMenu.dailyItems, - // ), - ], - ), + AppBanner( + height: 146.toAutoScaledHeight, + child: GestureDetector( + onPanUpdate: ((details) { + // Swiping in right direction. + if (details.delta.dx > 0) { + // move to previous week + context.read().add( + PreviousWeekChangeEvent( + previousWeekId: state.weekMenu.weekId - 1, + ), + ); + } + // Swiping in left direction. + if (details.delta.dx < 0) { + context.read().add( + NextWeekChangeEvent( + nextWeekId: state.weekMenu.weekId + 1, + ), + ); + } + }), + child: NewDayDateBar( + currDate: dates[state.currDayIndex], + dates: dates, + dateToMonthYear: dateToMonthYear, + blocObj: context.read(), ), - // DayDateBar( - // dates: dates, - // dateToMonthYear: dateToMonthYear, - // currDate: currDate, - // ), - if (isCheckedOut) ...[ - Padding( - padding: const EdgeInsets.fromLTRB(0, 14, 0, 14), - child: Text( - "You are currently checked-out", - style: AppTheme.bodyText1.copyWith( - fontFamily: 'Noto Sans', - fontSize: 14, - color: AppTheme.customRed), - ), - ), - Padding( - padding: const EdgeInsets.fromLTRB(0, 0, 0, 14), - child: GestureDetector( - onTap: () { - //TODO: add check in functionality - }, - child: const RoundEdgeTextOnlyContainer( - text: "CHECK IN"), - ), - ) - ], - // BlocSelector( - // selector: (state) => DayMenuFull( - // dayMenu: weekMenu.dayMenus[currDayIndex], - // dailyItems: weekMenu.dailyItems), - // builder: (context, state) { - // return - SizedBox( - height: 423, - child: SingleChildScrollView( - child: YourMealDailyCardsCombined( - dayMenu: - state.weekMenu.dayMenus[state.currDayIndex], - dailyItems: state.weekMenu.dailyItems), - ), - ) //; - // }, - // ), - ], + ), ), - if (!isCheckedOut) ...[ - Column( - children: [ - GestureDetector( - child: const RoundEdgeTextOnlyContainer( - text: "CHECK OUT"), - onTap: () { - context - .read() - .add(const CheckOutEvent()); - }, // TODO: add checkout functionality - ), - const SizedBox( - height: 16, - ) - ], + // DayDateBar( + // dates: dates, + // dateToMonthYear: dateToMonthYear, + // currDate: currDate, + // ), + if (isCheckedOut) ...[ + Padding( + padding: + EdgeInsets.fromLTRB(0, 0, 0, 14.toAutoScaledHeight), + child: Text( + "You are currently checked-out", + style: AppTheme.bodyText1.copyWith( + fontFamily: 'Noto Sans', + fontSize: 14.toAutoScaledFont, + color: AppTheme.customRed), + ), + ), + Padding( + padding: + EdgeInsets.fromLTRB(0, 0, 0, 14.toAutoScaledHeight), + child: GestureDetector( + onTap: () { + //TODO: add check in functionality + }, + child: + const RoundEdgeTextOnlyContainer(text: "CHECK IN"), + ), ) - ] + ], + Expanded( + child: SingleChildScrollView( + child: Column(children: [ + // BlocSelector( + // selector: (state) => DayMenuFull( + // dayMenu: weekMenu.dayMenus[currDayIndex], + // dailyItems: weekMenu.dailyItems), + // builder: (context, state) { + // return + YourMealDailyCardsCombined( + dayMenu: + state.weekMenu.dayMenus[state.currDayIndex], + dailyItems: state.weekMenu.dailyItems), + ]), + ), + ) ]); } else { // TODO: ask for final confirmation with designers diff --git a/pubspec.lock b/pubspec.lock index d25ab60d..35684717 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,10 +5,10 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: eb376e9acf6938204f90eb3b1f00b578640d3188b4c8a8ec054f9f479af8d051 + sha256: ae92f5d747aee634b87f89d9946000c2de774be1d6ac3e58268224348cd0101a url: "https://pub.dev" source: hosted - version: "64.0.0" + version: "61.0.0" _flutterfire_internals: dependency: transitive description: @@ -21,10 +21,10 @@ packages: dependency: transitive description: name: analyzer - sha256: "69f54f967773f6c26c7dcb13e93d7ccee8b17a641689da39e878d5cf13b06893" + sha256: ea3d8652bda62982addfd92fdc2d0214e5f82e43325104990d4f4c4a2a313562 url: "https://pub.dev" source: hosted - version: "6.2.0" + version: "5.13.0" args: dependency: transitive description: @@ -45,18 +45,18 @@ packages: dependency: "direct main" description: name: auto_route - sha256: "35e5c7f8de56ec07c40fca4c953cb7d1d113e26d50bd876a4130a9b874923f27" + sha256: "02120972925a567c37921fa28ac7e90680c7095dd0e70711353737ec2727cdc6" url: "https://pub.dev" source: hosted - version: "7.8.1" + version: "7.4.0" auto_route_generator: dependency: "direct dev" description: name: auto_route_generator - sha256: e7aa9ab44b77cd31a4619d94db645ab5736e543fd0b4c6058c281249e479dfb8 + sha256: d0555913cc54153c38b1dd4f69e0d6a623818ca7195e7c1437901d52b2596eec url: "https://pub.dev" source: hosted - version: "7.3.1" + version: "7.1.1" bloc: dependency: "direct main" description: @@ -309,26 +309,26 @@ packages: dependency: "direct main" description: name: firebase_messaging - sha256: db4a38be54fd84849c21be1ae1b44f0d4637eec1069bf5c49ea95e81f582bbc0 + sha256: "6c1a2a047d6f165b7c5f947467ac5138731a2af82c7af1c12d691dbb834f6b73" url: "https://pub.dev" source: hosted - version: "14.6.6" + version: "14.6.7" firebase_messaging_platform_interface: dependency: transitive description: name: firebase_messaging_platform_interface - sha256: "164119eed47ff19284e28bea9165a03da110c56ea09dd996622cfccad14d0efd" + sha256: bcba58d28f8cda607a323240c6d314c2c62b62ebfbb0f2d704ebefef07b52b5f url: "https://pub.dev" source: hosted - version: "4.5.5" + version: "4.5.6" firebase_messaging_web: dependency: transitive description: name: firebase_messaging_web - sha256: "6196d20731733834d7afb175c4345be57ddbd5daebca83cd52a430d62c2279fe" + sha256: "962d09ec9dfa486cbbc218258ad41e8ec7997a2eba46919049496e1cafd960c5" url: "https://pub.dev" source: hosted - version: "3.5.5" + version: "3.5.6" firebase_remote_config: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index fd64869c..112a385e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -14,7 +14,7 @@ dependencies: sdk: flutter cupertino_icons: ^1.0.2 - auto_route: ^7.8.0 + auto_route: 7.4.0 flutter_bloc: ^8.1.3 equatable: ^2.0.5 firebase_analytics: ^10.4.4 @@ -40,7 +40,7 @@ dependencies: flutter_svg_provider: ^1.0.6 dev_dependencies: - auto_route_generator: ^7.3.0 + auto_route_generator: 7.1.1 build_runner: ">2.3.0 <4.0.0" flutter_test: