From 459bc443476a7174a3156e8f6df21a39919e1beb Mon Sep 17 00:00:00 2001 From: shivamchauhan29 Date: Sun, 22 Oct 2023 10:09:11 +0530 Subject: [PATCH 1/3] updated with the latest version --- .../plugins/GeneratedPluginRegistrant.java | 4 +- android/build.gradle | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- lib/app/components/category_item.dart | 18 +- lib/app/components/custom_button.dart | 28 +- lib/app/components/custom_card.dart | 7 +- lib/app/components/custom_form_field.dart | 108 ++++--- lib/app/components/custom_icon_button.dart | 10 +- .../components/custom_loading_overlay.dart | 49 ++- lib/app/components/no_data.dart | 13 +- lib/app/components/product_count_item.dart | 9 +- lib/app/components/product_item.dart | 43 ++- lib/app/modules/base/views/base_view.dart | 18 +- .../modules/calendar/views/calendar_view.dart | 4 +- lib/app/modules/cart/views/cart_view.dart | 38 +-- .../modules/cart/views/widgets/cart_item.dart | 8 +- .../modules/category/views/category_view.dart | 4 +- lib/app/modules/home/views/home_view.dart | 29 +- .../views/product_details_view.dart | 75 ++--- .../modules/products/views/products_view.dart | 4 +- .../modules/profile/views/profile_view.dart | 4 +- .../splash/controllers/splash_controller.dart | 4 +- .../modules/welcome/views/welcome_view.dart | 41 +-- lib/app/routes/app_pages.dart | 23 +- lib/app/routes/app_routes.dart | 40 +-- lib/config/theme/my_fonts.dart | 22 +- lib/config/theme/my_styles.dart | 193 ++++++------ lib/config/theme/my_theme.dart | 89 +++--- pubspec.lock | 293 +++++++++++------- 29 files changed, 680 insertions(+), 502 deletions(-) diff --git a/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java b/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java index d87fdb1..ee5cd07 100644 --- a/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java +++ b/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java @@ -17,12 +17,12 @@ public final class GeneratedPluginRegistrant { public static void registerWith(@NonNull FlutterEngine flutterEngine) { try { flutterEngine.getPlugins().add(new dev.flutter.plugins.integration_test.IntegrationTestPlugin()); - } catch(Exception e) { + } catch (Exception e) { Log.e(TAG, "Error registering plugin integration_test, dev.flutter.plugins.integration_test.IntegrationTestPlugin", e); } try { flutterEngine.getPlugins().add(new io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin()); - } catch(Exception e) { + } catch (Exception e) { Log.e(TAG, "Error registering plugin shared_preferences_android, io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin", e); } } diff --git a/android/build.gradle b/android/build.gradle index 4256f91..0a2d6a1 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -26,6 +26,6 @@ subprojects { project.evaluationDependsOn(':app') } -task clean(type: Delete) { +tasks.register("clean", Delete) { delete rootProject.buildDir } diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index bc6a58a..cfe88f6 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip diff --git a/lib/app/components/category_item.dart b/lib/app/components/category_item.dart index 660bf74..37d228f 100644 --- a/lib/app/components/category_item.dart +++ b/lib/app/components/category_item.dart @@ -18,7 +18,7 @@ class CategoryItem extends StatelessWidget { Widget build(BuildContext context) { final theme = context.theme; return GestureDetector( - onTap: () => Get.toNamed(Routes.PRODUCTS), + onTap: () => Get.toNamed(Routes.products), child: Column( children: [ CircleAvatar( @@ -27,14 +27,16 @@ class CategoryItem extends StatelessWidget { child: SvgPicture.asset(category.image), ).animate().fade(duration: 200.ms), 10.verticalSpace, - Text(category.title, style: theme.textTheme.headline6) - .animate().fade().slideY( - duration: 200.ms, - begin: 1, - curve: Curves.easeInSine, - ), + Text(category.title, style: theme.textTheme.bodyMedium) + .animate() + .fade() + .slideY( + duration: 200.ms, + begin: 1, + curve: Curves.easeInSine, + ), ], ), ); } -} \ No newline at end of file +} diff --git a/lib/app/components/custom_button.dart b/lib/app/components/custom_button.dart index 381db88..61c8f42 100644 --- a/lib/app/components/custom_button.dart +++ b/lib/app/components/custom_button.dart @@ -59,22 +59,26 @@ class CustomButton extends StatelessWidget { onTap: !disabled ? onPressed : null, child: Ink( width: width ?? double.infinity, - padding: EdgeInsets.symmetric(horizontal: 20.w, vertical: verticalPadding ?? 14.h), + padding: EdgeInsets.symmetric( + horizontal: 20.w, vertical: verticalPadding ?? 14.h), decoration: BoxDecoration( borderRadius: BorderRadius.circular(radius ?? 10.r), border: Border.all(color: borderColor ?? Colors.transparent), - color: !disabled ? backgroundColor ?? Get.theme.primaryColor : Get.theme.primaryColor.withOpacity(0.5), + color: !disabled + ? backgroundColor ?? Get.theme.primaryColor + : Get.theme.primaryColor.withOpacity(0.5), gradient: gradient, boxShadow: !hasShadow || disabled - ? null - : [ - BoxShadow( - color: ( shadowColor ?? Colors.black).withOpacity(shadowOpacity), - spreadRadius: shadowSpreadRadius, - blurRadius: shadowBlurRadius, - offset: const Offset(0, 2), - ), - ], + ? null + : [ + BoxShadow( + color: (shadowColor ?? Colors.black) + .withOpacity(shadowOpacity), + spreadRadius: shadowSpreadRadius, + blurRadius: shadowBlurRadius, + offset: const Offset(0, 2), + ), + ], ), child: Row( mainAxisSize: MainAxisSize.max, @@ -82,7 +86,7 @@ class CustomButton extends StatelessWidget { children: [ Text( text, - style: Get.theme.textTheme.bodyText1?.copyWith( + style: Get.theme.textTheme.bodyMedium?.copyWith( fontSize: fontSize, fontWeight: fontWeight, color: foregroundColor ?? Colors.white, diff --git a/lib/app/components/custom_card.dart b/lib/app/components/custom_card.dart index 1248ae4..c4157cc 100644 --- a/lib/app/components/custom_card.dart +++ b/lib/app/components/custom_card.dart @@ -32,16 +32,17 @@ class CustomCard extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - title, style: theme.textTheme.headline5?.copyWith( + title, + style: theme.textTheme.bodyMedium?.copyWith( color: theme.primaryColor, ), ), 4.verticalSpace, - Text(subtitle, style: theme.textTheme.bodyText2), + Text(subtitle, style: theme.textTheme.bodySmall), ], ) ], ), ); } -} \ No newline at end of file +} diff --git a/lib/app/components/custom_form_field.dart b/lib/app/components/custom_form_field.dart index ddce9d5..6b66901 100644 --- a/lib/app/components/custom_form_field.dart +++ b/lib/app/components/custom_form_field.dart @@ -51,7 +51,6 @@ class CustomFormField extends StatefulWidget { final bool isSearchField; // will show cancel prefix icon to cancel search final Function? onCanceled; // callback for cancel (if its search field) - const CustomFormField({ Key? key, this.hint, @@ -105,7 +104,6 @@ class CustomFormField extends StatefulWidget { } class _CustomFormFieldState extends State { - String text = ''; @override @@ -114,11 +112,10 @@ class _CustomFormFieldState extends State { color: Colors.transparent, child: Theme( data: Get.theme.copyWith( - primaryColor: widget.iconColor ?? Get.theme.primaryColor, - colorScheme: Get.theme.colorScheme.copyWith( - primary: widget.iconColor ?? Get.theme.primaryColor, - ) - ), + primaryColor: widget.iconColor ?? Get.theme.primaryColor, + colorScheme: Get.theme.colorScheme.copyWith( + primary: widget.iconColor ?? Get.theme.primaryColor, + )), child: TextFormField( textAlign: widget.textAlign ?? TextAlign.start, enabled: widget.enabled, @@ -128,13 +125,15 @@ class _CustomFormFieldState extends State { //cursorHeight: 15, autovalidateMode: AutovalidateMode.onUserInteraction, initialValue: widget.initialValue, - style: MyStyles.getTextTheme(isLightTheme: Get.isDarkMode).bodyText2!.copyWith( - fontSize: widget.textSize ?? 14.sp, - color: widget.textColor ?? Colors.black.withOpacity(0.8), - ), + style: MyStyles.getTextTheme(isLightTheme: Get.isDarkMode) + .bodySmall! + .copyWith( + fontSize: widget.textSize ?? 14.sp, + color: widget.textColor ?? Colors.black.withOpacity(0.8), + ), onSaved: widget.onFieldSubmit, onEditingComplete: widget.onEditingComplete, - onChanged: (value){ + onChanged: (value) { setState(() { text = value; }); @@ -144,34 +143,73 @@ class _CustomFormFieldState extends State { maxLines: widget.obscureText == true ? 1 : widget.maxLines, expands: widget.expands ?? false, decoration: InputDecoration( - label: widget.label == null ? null : Text(widget.label ?? '', style: TextStyle(fontSize: widget.labelSize),), - suffixIcon: widget.isSearchField ? text.isEmpty ? null : GestureDetector(onTap: (){ - setState(() { - widget.controller?.clear(); - text = ''; - widget.onCanceled?.call(); - FocusScope.of(context).unfocus(); - }); - },child: Icon(Icons.close,color: Get.theme.iconTheme.color,)) : widget.suffixIcon, + label: widget.label == null + ? null + : Text( + widget.label ?? '', + style: TextStyle(fontSize: widget.labelSize), + ), + suffixIcon: widget.isSearchField + ? text.isEmpty + ? null + : GestureDetector( + onTap: () { + setState(() { + widget.controller?.clear(); + text = ''; + widget.onCanceled?.call(); + FocusScope.of(context).unfocus(); + }); + }, + child: Icon( + Icons.close, + color: Get.theme.iconTheme.color, + )) + : widget.suffixIcon, prefixIcon: widget.prefixIcon, - contentPadding: widget.contentPadding ?? EdgeInsets.symmetric(vertical: 12.h, horizontal: 20.w), + contentPadding: widget.contentPadding ?? + EdgeInsets.symmetric(vertical: 12.h, horizontal: 20.w), isDense: widget.isDense, filled: true, fillColor: widget.backgroundColor ?? const Color(0xFFF9F9F9), - hintStyle: MyFonts.getAppFontType.copyWith( - fontSize: widget.hintFontSize ?? 14.sp, - fontWeight: widget.hintFontWeight ?? FontWeight.normal, - color: widget.hintColor ?? Colors.black.withOpacity(0.4) - ), + hintStyle: MyFonts.getAppFontType.copyWith( + fontSize: widget.hintFontSize ?? 14.sp, + fontWeight: widget.hintFontWeight ?? FontWeight.normal, + color: widget.hintColor ?? Colors.black.withOpacity(0.4)), hintText: widget.hint, - focusedErrorBorder: widget.errorBorder ?? OutlineInputBorder(borderSide: const BorderSide(color: Colors.redAccent, width: 0.0), borderRadius: BorderRadius.circular(widget.borderRound ?? 10)), - disabledBorder: OutlineInputBorder(borderSide: BorderSide(color: Colors.grey.withOpacity(0), width: 0.0), borderRadius: BorderRadius.circular(widget.borderRound ?? 10)), - errorBorder: widget.errorBorder ?? OutlineInputBorder(borderSide: const BorderSide(color: Colors.redAccent, width: 0.0), borderRadius: BorderRadius.circular(widget.borderRound ?? 10)), - enabledBorder: widget.enabledBorder ?? OutlineInputBorder(borderSide: BorderSide(color: widget.enabledBorder == null ? Colors.transparent : Colors.grey[300]!, width: 0.0), borderRadius: BorderRadius.circular(widget.borderRound ?? 10)), - focusedBorder: widget.focusedBorder ?? OutlineInputBorder( - borderSide: BorderSide(color: widget.focusedBorderColor ?? Theme.of(context).primaryColor, width: 1.0), - borderRadius: BorderRadius.circular(widget.borderRound ?? 10), - ), + focusedErrorBorder: widget.errorBorder ?? + OutlineInputBorder( + borderSide: + const BorderSide(color: Colors.redAccent, width: 0.0), + borderRadius: + BorderRadius.circular(widget.borderRound ?? 10)), + disabledBorder: OutlineInputBorder( + borderSide: + BorderSide(color: Colors.grey.withOpacity(0), width: 0.0), + borderRadius: BorderRadius.circular(widget.borderRound ?? 10)), + errorBorder: widget.errorBorder ?? + OutlineInputBorder( + borderSide: + const BorderSide(color: Colors.redAccent, width: 0.0), + borderRadius: + BorderRadius.circular(widget.borderRound ?? 10)), + enabledBorder: widget.enabledBorder ?? + OutlineInputBorder( + borderSide: BorderSide( + color: widget.enabledBorder == null + ? Colors.transparent + : Colors.grey[300]!, + width: 0.0), + borderRadius: + BorderRadius.circular(widget.borderRound ?? 10)), + focusedBorder: widget.focusedBorder ?? + OutlineInputBorder( + borderSide: BorderSide( + color: widget.focusedBorderColor ?? + Theme.of(context).primaryColor, + width: 1.0), + borderRadius: BorderRadius.circular(widget.borderRound ?? 10), + ), ), validator: widget.validator, controller: widget.controller, diff --git a/lib/app/components/custom_icon_button.dart b/lib/app/components/custom_icon_button.dart index 99d015e..ebf62ad 100644 --- a/lib/app/components/custom_icon_button.dart +++ b/lib/app/components/custom_icon_button.dart @@ -26,10 +26,12 @@ class CustomIconButton extends StatelessWidget { width: width ?? 44.w, height: height ?? 44.h, child: Material( - color: backgroundColor ?? theme.backgroundColor, - shape: borderColor == null ? const CircleBorder() : CircleBorder( - side: BorderSide(color: borderColor!), - ), + color: backgroundColor ?? theme.primaryColor.withOpacity(0.1), + shape: borderColor == null + ? const CircleBorder() + : CircleBorder( + side: BorderSide(color: borderColor!), + ), child: InkWell( onTap: onPressed, child: icon, diff --git a/lib/app/components/custom_loading_overlay.dart b/lib/app/components/custom_loading_overlay.dart index f59cf93..8ad88c4 100644 --- a/lib/app/components/custom_loading_overlay.dart +++ b/lib/app/components/custom_loading_overlay.dart @@ -8,20 +8,23 @@ showLoadingOverLay({ required Future Function() asyncFunction, String? msg, }) async { - await Get.showOverlay(asyncFunction: () async { - try{ - await asyncFunction(); - } catch(error) { - rethrow; - } - }, loadingWidget: Center( - child: _getLoadingIndicator(msg: msg), - ), opacity: 0.7, + await Get.showOverlay( + asyncFunction: () async { + try { + await asyncFunction(); + } catch (error) { + rethrow; + } + }, + loadingWidget: Center( + child: _getLoadingIndicator(msg: msg), + ), + opacity: 0.7, opacityColor: Colors.black, ); } -Widget _getLoadingIndicator({String? msg}){ +Widget _getLoadingIndicator({String? msg}) { return Container( padding: EdgeInsets.symmetric( horizontal: 20.w, @@ -31,10 +34,24 @@ Widget _getLoadingIndicator({String? msg}){ borderRadius: BorderRadius.circular(10.r), color: Colors.white, ), - child: Column(mainAxisSize: MainAxisSize.min,children: [ - Image.asset('assets/images/app_icon.png',height: 45.h,), - SizedBox(width: 8.h,), - Text(msg ?? Strings.loading.tr,style: Get.theme.textTheme.bodyText1), - ],), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Image.asset( + 'assets/images/app_icon.png', + height: 45.h, + ), + SizedBox( + width: 8.h, + ), + Text( + msg ?? Strings.loading.tr, + style: Get.theme.textTheme.bodyMedium?.copyWith( + fontSize: 16.sp, + color: Get.theme.primaryColor, + ), + ), + ], + ), ); -} \ No newline at end of file +} diff --git a/lib/app/components/no_data.dart b/lib/app/components/no_data.dart index 6f6bfb1..a9eb1fa 100644 --- a/lib/app/components/no_data.dart +++ b/lib/app/components/no_data.dart @@ -14,9 +14,18 @@ class NoData extends StatelessWidget { child: Column( children: [ 80.verticalSpace, - Image.asset(Constants.logo, width: 313.w, height: 260.h,), + Image.asset( + Constants.logo, + width: 313.w, + height: 260.h, + ), 20.verticalSpace, - Text(text ?? 'No Data', style: context.textTheme.headline4), + Text( + text ?? 'No Data', + style: context.textTheme.bodyMedium?.copyWith( + color: context.theme.primaryColor, + ), + ), ], ), ); diff --git a/lib/app/components/product_count_item.dart b/lib/app/components/product_count_item.dart index dafa365..6e95bfd 100644 --- a/lib/app/components/product_count_item.dart +++ b/lib/app/components/product_count_item.dart @@ -10,10 +10,7 @@ import 'custom_icon_button.dart'; class ProductCountItem extends GetView { final ProductModel product; - const ProductCountItem({ - Key? key, - required this.product - }) : super(key: key); + const ProductCountItem({Key? key, required this.product}) : super(key: key); @override Widget build(BuildContext context) { @@ -35,7 +32,7 @@ class ProductCountItem extends GetView { id: 'ProductQuantity', builder: (_) => Text( product.quantity.toString(), - style: theme.textTheme.headline4, + style: theme.textTheme.bodySmall, ), ), 16.horizontalSpace, @@ -52,4 +49,4 @@ class ProductCountItem extends GetView { ], ); } -} \ No newline at end of file +} diff --git a/lib/app/components/product_item.dart b/lib/app/components/product_item.dart index 1d3d1e6..518fa07 100644 --- a/lib/app/components/product_item.dart +++ b/lib/app/components/product_item.dart @@ -8,16 +8,13 @@ import '../routes/app_pages.dart'; class ProductItem extends StatelessWidget { final ProductModel product; - const ProductItem({ - Key? key, - required this.product - }) : super(key: key); + const ProductItem({Key? key, required this.product}) : super(key: key); @override Widget build(BuildContext context) { final theme = context.theme; return GestureDetector( - onTap: () => Get.toNamed(Routes.PRODUCT_DETAILS, arguments: product), + onTap: () => Get.toNamed(Routes.productDetails, arguments: product), child: Container( decoration: BoxDecoration( color: theme.cardColor, @@ -29,9 +26,8 @@ class ProductItem extends StatelessWidget { right: 12.w, bottom: 12.h, child: GestureDetector( - onTap: () => Get.toNamed( - Routes.PRODUCT_DETAILS, arguments: product - ), + onTap: () => + Get.toNamed(Routes.productDetails, arguments: product), child: CircleAvatar( radius: 18.r, backgroundColor: theme.primaryColor, @@ -44,9 +40,10 @@ class ProductItem extends StatelessWidget { left: 26.w, right: 25.w, child: Image.asset(product.image).animate().slideX( - duration: 200.ms, - begin: 1, curve: Curves.easeInSine, - ), + duration: 200.ms, + begin: 1, + curve: Curves.easeInSine, + ), ), Positioned( left: 16.w, @@ -54,21 +51,21 @@ class ProductItem extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text(product.name, style: theme.textTheme.headline6) - .animate().fade().slideY( - duration: 200.ms, - begin: 1, curve: Curves.easeInSine, - ), + Text( + product.name, + ).animate().fade().slideY( + duration: 200.ms, + begin: 1, + curve: Curves.easeInSine, + ), 5.verticalSpace, Text( '1kg, ${product.price}\$', - style: theme.textTheme.headline5?.copyWith( - color: theme.accentColor, - ), ).animate().fade().slideY( - duration: 200.ms, - begin: 2, curve: Curves.easeInSine, - ), + duration: 200.ms, + begin: 2, + curve: Curves.easeInSine, + ), ], ), ), @@ -77,4 +74,4 @@ class ProductItem extends StatelessWidget { ), ); } -} \ No newline at end of file +} diff --git a/lib/app/modules/base/views/base_view.dart b/lib/app/modules/base/views/base_view.dart index 8e15957..7331b6f 100644 --- a/lib/app/modules/base/views/base_view.dart +++ b/lib/app/modules/base/views/base_view.dart @@ -1,7 +1,8 @@ +import 'package:badges/badges.dart' as badges; +import 'package:badges/badges.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_svg/flutter_svg.dart'; -import 'package:badges/badges.dart'; import 'package:get/get.dart'; import '../../../../utils/constants.dart'; @@ -70,28 +71,29 @@ class BaseView extends GetView { floatingActionButton: FloatingActionButton( elevation: 0.0, backgroundColor: Colors.transparent, - onPressed:() => Get.toNamed(Routes.CART), + onPressed: () => Get.toNamed(Routes.cart), child: GetBuilder( id: 'CartBadge', - builder: (_) => Badge( + builder: (_) => badges.Badge( position: BadgePosition.bottomEnd(bottom: -16, end: 13), badgeContent: Text( controller.cartItemsCount.toString(), - style: theme.textTheme.bodyText2?.copyWith( + style: theme.textTheme.bodyMedium?.copyWith( color: Colors.white, fontWeight: FontWeight.bold, ), ), badgeStyle: BadgeStyle( elevation: 2, - badgeColor: theme.accentColor, + badgeColor: theme.primaryColor, borderSide: const BorderSide(color: Colors.white, width: 1), ), child: CircleAvatar( radius: 22.r, backgroundColor: theme.primaryColor, child: SvgPicture.asset( - Constants.cartIcon, fit: BoxFit.none, + Constants.cartIcon, + fit: BoxFit.none, ), ), ), @@ -105,8 +107,8 @@ class BaseView extends GetView { return BottomNavigationBarItem( label: label, icon: SvgPicture.asset(icon, color: Get.theme.iconTheme.color), - activeIcon: SvgPicture.asset(icon, color: Get.theme.appBarTheme.iconTheme?.color), + activeIcon: + SvgPicture.asset(icon, color: Get.theme.appBarTheme.iconTheme?.color), ); } - } diff --git a/lib/app/modules/calendar/views/calendar_view.dart b/lib/app/modules/calendar/views/calendar_view.dart index ae4ef40..7a66b6f 100644 --- a/lib/app/modules/calendar/views/calendar_view.dart +++ b/lib/app/modules/calendar/views/calendar_view.dart @@ -11,10 +11,10 @@ class CalendarView extends GetView { Widget build(BuildContext context) { return Scaffold( appBar: AppBar( - title: Text('Calendar', style: context.theme.textTheme.headline3), + title: Text('Calendar', style: context.theme.textTheme.bodyMedium), centerTitle: true, ), body: const NoData(text: 'This is Calendar Screen'), ); } -} \ No newline at end of file +} diff --git a/lib/app/modules/cart/views/cart_view.dart b/lib/app/modules/cart/views/cart_view.dart index a336978..cdb1071 100644 --- a/lib/app/modules/cart/views/cart_view.dart +++ b/lib/app/modules/cart/views/cart_view.dart @@ -35,7 +35,7 @@ class CartView extends GetView { color: theme.appBarTheme.iconTheme?.color, ), ), - Text('Cart 🛒', style: theme.textTheme.headline3), + Text('Cart 🛒', style: theme.textTheme.bodyMedium), const Opacity( opacity: 0.0, child: CustomIconButton(onPressed: null, icon: Center()), @@ -50,21 +50,21 @@ class CartView extends GetView { 24.verticalSpace, Expanded( child: controller.products.isEmpty - ? const NoData(text: 'No Products in Your Cart Yet!') - : ListView.separated( - separatorBuilder: (_, index) => Padding( - padding: EdgeInsets.only(top: 12.h, bottom: 24.h), - child: const Divider(thickness: 1), + ? const NoData(text: 'No Products in Your Cart Yet!') + : ListView.separated( + separatorBuilder: (_, index) => Padding( + padding: EdgeInsets.only(top: 12.h, bottom: 24.h), + child: const Divider(thickness: 1), + ), + itemCount: controller.products.length, + itemBuilder: (context, index) => CartItem( + product: controller.products[index], + ).animate(delay: (100 * index).ms).fade().slideX( + duration: 300.ms, + begin: -1, + curve: Curves.easeInSine, + ), ), - itemCount: controller.products.length, - itemBuilder: (context, index) => CartItem( - product: controller.products[index], - ).animate(delay: (100 * index).ms).fade().slideX( - duration: 300.ms, - begin: -1, - curve: Curves.easeInSine, - ), - ), ), 30.verticalSpace, Visibility( @@ -79,10 +79,10 @@ class CartView extends GetView { verticalPadding: 16.h, hasShadow: false, ).animate().fade().slideY( - duration: 300.ms, - begin: 1, - curve: Curves.easeInSine, - ), + duration: 300.ms, + begin: 1, + curve: Curves.easeInSine, + ), ), ), 30.verticalSpace, diff --git a/lib/app/modules/cart/views/widgets/cart_item.dart b/lib/app/modules/cart/views/widgets/cart_item.dart index 130b438..508ecb3 100644 --- a/lib/app/modules/cart/views/widgets/cart_item.dart +++ b/lib/app/modules/cart/views/widgets/cart_item.dart @@ -26,12 +26,12 @@ class CartItem extends GetView { Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text(product.name, style: theme.textTheme.headline5), + Text(product.name, style: theme.textTheme.titleSmall), 5.verticalSpace, Text( '1kg, ${product.price}\$', - style: theme.textTheme.headline5?.copyWith( - color: theme.accentColor, + style: theme.textTheme.titleSmall?.copyWith( + color: theme.primaryColor, ), ), ], @@ -42,4 +42,4 @@ class CartItem extends GetView { ), ); } -} \ No newline at end of file +} diff --git a/lib/app/modules/category/views/category_view.dart b/lib/app/modules/category/views/category_view.dart index c2d6d7a..7afab6b 100644 --- a/lib/app/modules/category/views/category_view.dart +++ b/lib/app/modules/category/views/category_view.dart @@ -11,10 +11,10 @@ class CategoryView extends GetView { Widget build(BuildContext context) { return Scaffold( appBar: AppBar( - title: Text('Category', style: context.theme.textTheme.headline3), + title: Text('Category', style: context.theme.textTheme.bodyMedium), centerTitle: true, ), body: const NoData(text: 'This is Category Screen'), ); } -} \ No newline at end of file +} diff --git a/lib/app/modules/home/views/home_view.dart b/lib/app/modules/home/views/home_view.dart index 81dde56..666ec28 100644 --- a/lib/app/modules/home/views/home_view.dart +++ b/lib/app/modules/home/views/home_view.dart @@ -40,13 +40,12 @@ class HomeView extends GetView { contentPadding: EdgeInsets.symmetric(horizontal: 24.w), title: Text( 'Good morning', - style: theme.textTheme.bodyText2?.copyWith( - fontSize: 12.sp - ), + style: theme.textTheme.bodySmall + ?.copyWith(fontSize: 12.sp), ), subtitle: Text( 'Amelia Barlow', - style: theme.textTheme.headline5?.copyWith( + style: theme.textTheme.titleSmall?.copyWith( fontWeight: FontWeight.normal, ), ), @@ -67,8 +66,8 @@ class HomeView extends GetView { id: 'Theme', builder: (_) => Icon( controller.isLightTheme - ? Icons.dark_mode_outlined - : Icons.light_mode_outlined, + ? Icons.dark_mode_outlined + : Icons.light_mode_outlined, color: theme.appBarTheme.iconTheme?.color, size: 20, ), @@ -87,17 +86,13 @@ class HomeView extends GetView { maxLines: 1, borderRound: 60.r, contentPadding: EdgeInsets.symmetric( - vertical: 10.h, - horizontal: 10.w - ), + vertical: 10.h, horizontal: 10.w), focusedBorderColor: Colors.transparent, isSearchField: true, keyboardType: TextInputType.text, textInputAction: TextInputAction.search, - prefixIcon: SvgPicture.asset( - Constants.searchIcon, - fit: BoxFit.none - ), + prefixIcon: SvgPicture.asset(Constants.searchIcon, + fit: BoxFit.none), ), ), 20.verticalSpace, @@ -130,11 +125,11 @@ class HomeView extends GetView { children: [ Text( 'Categories 😋', - style: theme.textTheme.headline4, + style: theme.textTheme.titleSmall, ), Text( 'See all', - style: theme.textTheme.headline6?.copyWith( + style: theme.textTheme.titleSmall?.copyWith( color: theme.primaryColor, fontWeight: FontWeight.normal, ), @@ -154,11 +149,11 @@ class HomeView extends GetView { children: [ Text( 'Best selling 🔥', - style: theme.textTheme.headline4, + style: theme.textTheme.titleSmall, ), Text( 'See all', - style: theme.textTheme.headline6?.copyWith( + style: theme.textTheme.titleSmall?.copyWith( color: theme.primaryColor, fontWeight: FontWeight.normal, ), diff --git a/lib/app/modules/product_details/views/product_details_view.dart b/lib/app/modules/product_details/views/product_details_view.dart index f2bdd7c..01c318e 100644 --- a/lib/app/modules/product_details/views/product_details_view.dart +++ b/lib/app/modules/product_details/views/product_details_view.dart @@ -68,9 +68,9 @@ class ProductDetailsView extends GetView { width: 250.w, height: 225.h, ).animate().fade().scale( - duration: 800.ms, - curve: Curves.fastOutSlowIn, - ), + duration: 800.ms, + curve: Curves.fastOutSlowIn, + ), ), ], ), @@ -82,16 +82,16 @@ class ProductDetailsView extends GetView { children: [ Text( controller.product.name, - style: theme.textTheme.headline2, + style: theme.textTheme.bodyMedium, ).animate().fade().slideX( - duration: 300.ms, - begin: -1, - curve: Curves.easeInSine, - ), + duration: 300.ms, + begin: -1, + curve: Curves.easeInSine, + ), const Spacer(), - ProductCountItem(product: controller.product).animate().fade( - duration: 200.ms - ), + ProductCountItem(product: controller.product) + .animate() + .fade(duration: 200.ms), ], ), ), @@ -100,26 +100,26 @@ class ProductDetailsView extends GetView { padding: EdgeInsets.symmetric(horizontal: 24.w), child: Text( '1kg, ${controller.product.price}\$', - style: theme.textTheme.headline3?.copyWith( - color: theme.accentColor, + style: theme.textTheme.bodyLarge?.copyWith( + color: theme.primaryColor, ), ).animate().fade().slideX( - duration: 300.ms, - begin: -1, - curve: Curves.easeInSine, - ), + duration: 300.ms, + begin: -1, + curve: Curves.easeInSine, + ), ), 8.verticalSpace, Padding( padding: EdgeInsets.symmetric(horizontal: 24.w), child: Text( controller.product.description, - style: theme.textTheme.bodyText1, + style: theme.textTheme.bodySmall, ).animate().fade().slideX( - duration: 300.ms, - begin: -1, - curve: Curves.easeInSine, - ), + duration: 300.ms, + begin: -1, + curve: Curves.easeInSine, + ), ), 20.verticalSpace, Padding( @@ -133,15 +133,20 @@ class ProductDetailsView extends GetView { mainAxisSpacing: 16.h, mainAxisExtent: 80.h, ), - children: DummyHelper.cards.map((card) => CustomCard( - title: card['title']!, - subtitle: card['subtitle']!, - icon: card['icon']!, - )).toList().animate().fade().slideY( - duration: 300.ms, - begin: 1, - curve: Curves.easeInSine, - ), + children: DummyHelper.cards + .map((card) => CustomCard( + title: card['title']!, + subtitle: card['subtitle']!, + icon: card['icon']!, + )) + .toList() + .animate() + .fade() + .slideY( + duration: 300.ms, + begin: 1, + curve: Curves.easeInSine, + ), ), ), 30.verticalSpace, @@ -155,10 +160,10 @@ class ProductDetailsView extends GetView { verticalPadding: 16.h, hasShadow: false, ).animate().fade().slideY( - duration: 300.ms, - begin: 1, - curve: Curves.easeInSine, - ), + duration: 300.ms, + begin: 1, + curve: Curves.easeInSine, + ), ), 30.verticalSpace, ], diff --git a/lib/app/modules/products/views/products_view.dart b/lib/app/modules/products/views/products_view.dart index 46d91d6..69caac8 100644 --- a/lib/app/modules/products/views/products_view.dart +++ b/lib/app/modules/products/views/products_view.dart @@ -10,7 +10,7 @@ import '../controllers/products_controller.dart'; class ProductsView extends GetView { const ProductsView({Key? key}) : super(key: key); - + @override Widget build(BuildContext context) { final theme = context.theme; @@ -34,7 +34,7 @@ class ProductsView extends GetView { ), Text( 'Vegetables 🌽', - style: theme.textTheme.headline3, + style: theme.textTheme.bodyMedium, ), CustomIconButton( onPressed: () {}, diff --git a/lib/app/modules/profile/views/profile_view.dart b/lib/app/modules/profile/views/profile_view.dart index 330426f..97aa249 100644 --- a/lib/app/modules/profile/views/profile_view.dart +++ b/lib/app/modules/profile/views/profile_view.dart @@ -11,10 +11,10 @@ class ProfileView extends GetView { Widget build(BuildContext context) { return Scaffold( appBar: AppBar( - title: Text('Profile', style: context.theme.textTheme.headline3), + title: Text('Profile', style: context.theme.textTheme.bodyMedium), centerTitle: true, ), body: const NoData(text: 'This is Profile Screen'), ); } -} \ No newline at end of file +} diff --git a/lib/app/modules/splash/controllers/splash_controller.dart b/lib/app/modules/splash/controllers/splash_controller.dart index 7a0f188..03ec4f0 100644 --- a/lib/app/modules/splash/controllers/splash_controller.dart +++ b/lib/app/modules/splash/controllers/splash_controller.dart @@ -3,12 +3,10 @@ import 'package:get/get.dart'; import '../../../routes/app_pages.dart'; class SplashController extends GetxController { - @override void onInit() async { await Future.delayed(const Duration(seconds: 2)); - Get.offNamed(Routes.WELCOME); + Get.offNamed(Routes.welcome); super.onInit(); } - } diff --git a/lib/app/modules/welcome/views/welcome_view.dart b/lib/app/modules/welcome/views/welcome_view.dart index 35a5131..74b7cb4 100644 --- a/lib/app/modules/welcome/views/welcome_view.dart +++ b/lib/app/modules/welcome/views/welcome_view.dart @@ -36,48 +36,49 @@ class WelcomeView extends GetView { backgroundColor: theme.primaryColorDark, child: Image.asset( Constants.logo, - width: 40.33.w, height: 33.40.h, + width: 40.33.w, + height: 33.40.h, ), ).animate().fade().slideY( - duration: 300.ms, - begin: -1, - curve: Curves.easeInSine, - ), + duration: 300.ms, + begin: -1, + curve: Curves.easeInSine, + ), 30.verticalSpace, Text( 'Get your groceries delivered to your home', - style: theme.textTheme.headline1, + style: theme.textTheme.titleSmall, textAlign: TextAlign.center, ).animate().fade().slideY( - duration: 300.ms, - begin: -1, - curve: Curves.easeInSine, - ), + duration: 300.ms, + begin: -1, + curve: Curves.easeInSine, + ), 24.verticalSpace, Text( 'The best delivery app in town for delivering your daily fresh groceries', - style: theme.textTheme.bodyText1, + style: theme.textTheme.bodyLarge, textAlign: TextAlign.center, ).animate().fade().slideY( - duration: 300.ms, - begin: 1, - curve: Curves.easeInSine, - ), + duration: 300.ms, + begin: 1, + curve: Curves.easeInSine, + ), 40.verticalSpace, Padding( padding: EdgeInsets.symmetric(horizontal: 70.w), child: CustomButton( text: 'Shop now', - onPressed: () => Get.offNamed(Routes.BASE), + onPressed: () => Get.offNamed(Routes.base), fontSize: 16.sp, radius: 50.r, verticalPadding: 16.h, hasShadow: false, ).animate().fade().slideY( - duration: 300.ms, - begin: 1, - curve: Curves.easeInSine, - ), + duration: 300.ms, + begin: 1, + curve: Curves.easeInSine, + ), ), ], ), diff --git a/lib/app/routes/app_pages.dart b/lib/app/routes/app_pages.dart index 7daff56..a89c022 100644 --- a/lib/app/routes/app_pages.dart +++ b/lib/app/routes/app_pages.dart @@ -26,58 +26,59 @@ part 'app_routes.dart'; class AppPages { AppPages._(); - static const INITIAL = Routes.SPLASH; + // ignore: constant_identifier_names + static const INITIAL = Routes.splash; static final routes = [ GetPage( - name: _Paths.SPLASH, + name: _Paths.splash, page: () => const SplashView(), binding: SplashBinding(), ), GetPage( - name: _Paths.WELCOME, + name: _Paths.welcome, page: () => const WelcomeView(), binding: WelcomeBinding(), ), GetPage( - name: _Paths.BASE, + name: _Paths.base, page: () => const BaseView(), binding: BaseBinding(), ), GetPage( - name: _Paths.HOME, + name: _Paths.home, page: () => const HomeView(), binding: HomeBinding(), ), GetPage( - name: _Paths.CART, + name: _Paths.cart, page: () => const CartView(), binding: CartBinding(), ), GetPage( - name: _Paths.PRODUCT_DETAILS, + name: _Paths.productDetails, page: () => const ProductDetailsView(), binding: ProductDetailsBinding(), transition: Transition.rightToLeft, transitionDuration: const Duration(milliseconds: 250), ), GetPage( - name: _Paths.CATEGORY, + name: _Paths.category, page: () => const CategoryView(), binding: CategoryBinding(), ), GetPage( - name: _Paths.CALENDAR, + name: _Paths.calendar, page: () => const CalendarView(), binding: CalendarBinding(), ), GetPage( - name: _Paths.PROFILE, + name: _Paths.profile, page: () => const ProfileView(), binding: ProfileBinding(), ), GetPage( - name: _Paths.PRODUCTS, + name: _Paths.products, page: () => const ProductsView(), binding: ProductsBinding(), ), diff --git a/lib/app/routes/app_routes.dart b/lib/app/routes/app_routes.dart index 96c377c..cc9f4a0 100644 --- a/lib/app/routes/app_routes.dart +++ b/lib/app/routes/app_routes.dart @@ -3,28 +3,28 @@ part of 'app_pages.dart'; abstract class Routes { Routes._(); - static const SPLASH = _Paths.SPLASH; - static const BASE = _Paths.BASE; - static const HOME = _Paths.HOME; - static const CART = _Paths.CART; - static const PRODUCT_DETAILS = _Paths.PRODUCT_DETAILS; - static const WELCOME = _Paths.WELCOME; - static const CATEGORY = _Paths.CATEGORY; - static const CALENDAR = _Paths.CALENDAR; - static const PROFILE = _Paths.PROFILE; - static const PRODUCTS = _Paths.PRODUCTS; + static const splash = _Paths.splash; + static const base = _Paths.base; + static const home = _Paths.home; + static const cart = _Paths.cart; + static const productDetails = _Paths.productDetails; + static const welcome = _Paths.welcome; + static const category = _Paths.category; + static const calendar = _Paths.calendar; + static const profile = _Paths.profile; + static const products = _Paths.products; } abstract class _Paths { _Paths._(); - static const SPLASH = '/splash'; - static const WELCOME = '/welcome'; - static const BASE = '/base'; - static const HOME = '/home'; - static const CART = '/cart'; - static const PRODUCT_DETAILS = '/product-details'; - static const CATEGORY = '/category'; - static const CALENDAR = '/calendar'; - static const PROFILE = '/profile'; - static const PRODUCTS = '/products'; + static const splash = '/splash'; + static const welcome = '/welcome'; + static const base = '/base'; + static const home = '/home'; + static const cart = '/cart'; + static const productDetails = '/product-details'; + static const category = '/category'; + static const calendar = '/calendar'; + static const profile = '/profile'; + static const products = '/products'; } diff --git a/lib/config/theme/my_fonts.dart b/lib/config/theme/my_fonts.dart index 3a5d364..5d89220 100644 --- a/lib/config/theme/my_fonts.dart +++ b/lib/config/theme/my_fonts.dart @@ -4,10 +4,11 @@ import '../../app/data/local/my_shared_pref.dart'; import '../translations/localization_service.dart'; // todo configure text family and size -class MyFonts -{ +class MyFonts { // return the right font depending on app language - static TextStyle get getAppFontType => LocalizationService.supportedLanguagesFontsFamilies[MySharedPref.getCurrentLocal().languageCode]!; + static TextStyle get getAppFontType => + LocalizationService.supportedLanguagesFontsFamilies[ + MySharedPref.getCurrentLocal().languageCode]!; // headlines text font static TextStyle get headlineTextStyle => getAppFontType; @@ -19,10 +20,10 @@ class MyFonts static TextStyle get buttonTextStyle => getAppFontType; // app bar text font - static TextStyle get appBarTextStyle => getAppFontType; + static TextStyle get appBarTextStyle => getAppFontType; // chips text font - static TextStyle get chipTextStyle => getAppFontType; + static TextStyle get chipTextStyle => getAppFontType; // appbar font size static double get appBarTittleSize => 18.sp; @@ -32,12 +33,11 @@ class MyFonts static double get body2TextSize => 14.sp; // headlines font size - static double get headline1TextSize => 28.sp; static double get headline2TextSize => 24.sp; - static double get headline3TextSize => 20.sp; - static double get headline4TextSize => 18.sp; - static double get headline5TextSize => 16.sp; - static double get headline6TextSize => 14.sp; + static double get bodyMediumTextSize => 20.sp; + static double get titleSmallTextSize => 18.sp; + // static double get titleSmallTextSize => 16.sp; + // static double get titleSmallTextSize => 14.sp; //button font size static double get buttonTextSize => 16.sp; @@ -47,4 +47,4 @@ class MyFonts //chip font size static double get chipTextSize => 10.sp; -} \ No newline at end of file +} diff --git a/lib/config/theme/my_styles.dart b/lib/config/theme/my_styles.dart index eebf038..d4d85e7 100644 --- a/lib/config/theme/my_styles.dart +++ b/lib/config/theme/my_styles.dart @@ -1,13 +1,11 @@ import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; - import 'dark_theme_colors.dart'; import 'my_fonts.dart'; import 'light_theme_colors.dart'; class MyStyles { - ///icons theme + /// Icons theme static IconThemeData getIconTheme({required bool isLightTheme}) => IconThemeData( color: isLightTheme @@ -15,13 +13,12 @@ class MyStyles { : DarkThemeColors.iconColor, ); - ///app bar theme + /// App bar theme static AppBarTheme getAppBarTheme({required bool isLightTheme}) => AppBarTheme( elevation: 0, - scrolledUnderElevation: 0, titleTextStyle: - getTextTheme(isLightTheme: isLightTheme).bodyText1!.copyWith( + getTextTheme(isLightTheme: isLightTheme).bodyLarge!.copyWith( color: Colors.white, fontSize: MyFonts.appBarTittleSize, ), @@ -34,62 +31,77 @@ class MyStyles { : DarkThemeColors.appbarColor, ); - ///text theme + /// Text theme static TextTheme getTextTheme({required bool isLightTheme}) => TextTheme( - button: MyFonts.buttonTextStyle - .copyWith(fontSize: MyFonts.buttonTextSize), - bodyText1: (MyFonts.bodyTextStyle).copyWith( - fontWeight: FontWeight.bold, - fontSize: MyFonts.body1TextSize, - color: isLightTheme - ? LightThemeColors.bodyTextColor - : DarkThemeColors.bodyTextColor), - bodyText2: (MyFonts.bodyTextStyle).copyWith( - fontSize: MyFonts.body2TextSize, - color: isLightTheme - ? LightThemeColors.bodyTextColor - : DarkThemeColors.bodyTextColor), - headline1: (MyFonts.headlineTextStyle).copyWith( - fontSize: MyFonts.headline1TextSize, - fontWeight: FontWeight.bold, - color: isLightTheme - ? LightThemeColors.headlinesTextColor - : DarkThemeColors.headlinesTextColor), - headline2: (MyFonts.headlineTextStyle).copyWith( - fontSize: MyFonts.headline2TextSize, - fontWeight: FontWeight.bold, - color: isLightTheme - ? LightThemeColors.headlinesTextColor - : DarkThemeColors.headlinesTextColor), - headline3: (MyFonts.headlineTextStyle).copyWith( - fontSize: MyFonts.headline3TextSize, - fontWeight: FontWeight.bold, - color: isLightTheme - ? LightThemeColors.headlinesTextColor - : DarkThemeColors.headlinesTextColor), - headline4: (MyFonts.headlineTextStyle).copyWith( - fontSize: MyFonts.headline4TextSize, - fontWeight: FontWeight.bold, - color: isLightTheme - ? LightThemeColors.headlinesTextColor - : DarkThemeColors.headlinesTextColor), - headline5: (MyFonts.headlineTextStyle).copyWith( - fontSize: MyFonts.headline5TextSize, - fontWeight: FontWeight.bold, - color: isLightTheme - ? LightThemeColors.headlinesTextColor - : DarkThemeColors.headlinesTextColor), - headline6: (MyFonts.headlineTextStyle).copyWith( - fontSize: MyFonts.headline6TextSize, - fontWeight: FontWeight.bold, - color: isLightTheme - ? LightThemeColors.headlinesTextColor - : DarkThemeColors.headlinesTextColor), - caption: TextStyle( - color: isLightTheme - ? LightThemeColors.captionTextColor - : DarkThemeColors.captionTextColor, - fontSize: MyFonts.captionTextSize), + labelLarge: + MyFonts.buttonTextStyle.copyWith(fontSize: MyFonts.buttonTextSize), + bodyLarge: (MyFonts.bodyTextStyle).copyWith( + fontWeight: FontWeight.bold, + fontSize: MyFonts.body1TextSize, + color: isLightTheme + ? LightThemeColors.bodyTextColor + : DarkThemeColors.bodyTextColor, + ), + bodyMedium: (MyFonts.bodyTextStyle).copyWith( + // Use bodyText2 instead of bodySmall + fontSize: MyFonts.body2TextSize, + color: isLightTheme + ? LightThemeColors.bodyTextColor + : DarkThemeColors.bodyTextColor, + ), + displayLarge: (MyFonts.headlineTextStyle).copyWith( + fontSize: MyFonts.titleSmallTextSize, + fontWeight: FontWeight.bold, + color: isLightTheme + ? LightThemeColors.headlinesTextColor + : DarkThemeColors.headlinesTextColor, + ), + displayMedium: (MyFonts.headlineTextStyle).copyWith( + fontSize: MyFonts.headline2TextSize, + fontWeight: FontWeight.bold, + color: isLightTheme + ? LightThemeColors.headlinesTextColor + : DarkThemeColors.headlinesTextColor, + ), + displaySmall: (MyFonts.headlineTextStyle).copyWith( + // Use headline3 instead of bodyMedium + fontSize: MyFonts.bodyMediumTextSize, + fontWeight: FontWeight.bold, + color: isLightTheme + ? LightThemeColors.headlinesTextColor + : DarkThemeColors.headlinesTextColor, + ), + headlineMedium: (MyFonts.headlineTextStyle).copyWith( + // Use headline4 instead of titleSmall + fontSize: MyFonts.titleSmallTextSize, + fontWeight: FontWeight.bold, + color: isLightTheme + ? LightThemeColors.headlinesTextColor + : DarkThemeColors.headlinesTextColor, + ), + headlineSmall: (MyFonts.headlineTextStyle).copyWith( + // Use headline5 instead of headlineSmall + fontSize: MyFonts.titleSmallTextSize, + fontWeight: FontWeight.bold, + color: isLightTheme + ? LightThemeColors.headlinesTextColor + : DarkThemeColors.headlinesTextColor, + ), + titleLarge: (MyFonts.headlineTextStyle).copyWith( + // Use headline6 instead of displaySmall + fontSize: MyFonts.titleSmallTextSize, + fontWeight: FontWeight.bold, + color: isLightTheme + ? LightThemeColors.headlinesTextColor + : DarkThemeColors.headlinesTextColor, + ), + bodySmall: TextStyle( + // Use caption instead of bodyLarge + color: isLightTheme + ? LightThemeColors.captionTextColor + : DarkThemeColors.captionTextColor, + fontSize: MyFonts.captionTextSize, + ), ); static ChipThemeData getChipTheme({required bool isLightTheme}) { @@ -107,7 +119,7 @@ class MyStyles { ); } - ///Chips text style + /// Chips text style static TextStyle getChipTextStyle({required bool isLightTheme}) { return MyFonts.chipTextStyle.copyWith( fontSize: MyFonts.chipTextSize, @@ -117,53 +129,56 @@ class MyStyles { ); } - // elevated button text style - static MaterialStateProperty? getElevatedButtonTextStyle( - bool isLightTheme, - {bool isBold = true, - double? fontSize}) { - return MaterialStateProperty.resolveWith( + // Elevated button text style + static MaterialStateProperty getElevatedButtonTextStyle( + bool isLightTheme, { + bool isBold = true, + double? fontSize, + }) { + return MaterialStateProperty.resolveWith( (Set states) { if (states.contains(MaterialState.pressed)) { return MyFonts.buttonTextStyle.copyWith( - fontWeight: isBold ? FontWeight.bold : FontWeight.normal, - fontSize: fontSize ?? MyFonts.buttonTextSize, - color: isLightTheme - ? LightThemeColors.buttonTextColor - : DarkThemeColors.buttonTextColor); + fontWeight: isBold ? FontWeight.bold : FontWeight.normal, + fontSize: fontSize ?? MyFonts.buttonTextSize, + color: isLightTheme + ? LightThemeColors.buttonTextColor + : DarkThemeColors.buttonTextColor, + ); } else if (states.contains(MaterialState.disabled)) { return MyFonts.buttonTextStyle.copyWith( - fontSize: fontSize ?? MyFonts.buttonTextSize, - fontWeight: isBold ? FontWeight.bold : FontWeight.normal, - color: isLightTheme - ? LightThemeColors.buttonDisabledTextColor - : DarkThemeColors.buttonDisabledTextColor); - } - return MyFonts.buttonTextStyle.copyWith( fontSize: fontSize ?? MyFonts.buttonTextSize, fontWeight: isBold ? FontWeight.bold : FontWeight.normal, color: isLightTheme - ? LightThemeColors.buttonTextColor - : DarkThemeColors - .buttonTextColor); // Use the component's default. + ? LightThemeColors.buttonDisabledTextColor + : DarkThemeColors.buttonDisabledTextColor, + ); + } + return MyFonts.buttonTextStyle.copyWith( + fontSize: fontSize ?? MyFonts.buttonTextSize, + fontWeight: isBold ? FontWeight.bold : FontWeight.normal, + color: isLightTheme + ? LightThemeColors.buttonTextColor + : DarkThemeColors.buttonTextColor, + ); }, ); } - //elevated button theme data + // Elevated button theme data static ElevatedButtonThemeData getElevatedButtonTheme( {required bool isLightTheme}) => ElevatedButtonThemeData( style: ButtonStyle( shape: MaterialStateProperty.all( RoundedRectangleBorder( - borderRadius: BorderRadius.circular(6.r), - //side: BorderSide(color: Colors.teal, width: 2.0), + borderRadius: BorderRadius.circular(6), ), ), elevation: MaterialStateProperty.all(0), - padding: - MaterialStateProperty.all(EdgeInsets.symmetric(vertical: 8.h)), + padding: MaterialStateProperty.all( + const EdgeInsets.symmetric(vertical: 8), + ), textStyle: getElevatedButtonTextStyle(isLightTheme), backgroundColor: MaterialStateProperty.resolveWith( (Set states) { @@ -178,7 +193,7 @@ class MyStyles { } return isLightTheme ? LightThemeColors.buttonColor - : DarkThemeColors.buttonColor; // Use the component's default. + : DarkThemeColors.buttonColor; }, ), ), diff --git a/lib/config/theme/my_theme.dart b/lib/config/theme/my_theme.dart index b9288b0..fcc78dc 100644 --- a/lib/config/theme/my_theme.dart +++ b/lib/config/theme/my_theme.dart @@ -7,48 +7,65 @@ import 'light_theme_colors.dart'; import 'my_styles.dart'; class MyTheme { - static getThemeData({required bool isLight}){ + static getThemeData({required bool isLight}) { return ThemeData( - useMaterial3: true, - // main color (app bar,tabs..etc) - primaryColor: isLight ? LightThemeColors.primaryColor : DarkThemeColors.primaryColor, - primaryColorLight: isLight ? LightThemeColors.primaryColorLight : DarkThemeColors.primaryColorLight, - primaryColorDark: isLight ? LightThemeColors.primaryColorDark : DarkThemeColors.primaryColorDark, - // secondary color (for checkbox,float button, radio..etc) - accentColor: isLight ? LightThemeColors.accentColor : DarkThemeColors.accentColor, - // color contrast (if the theme is dark text should be white for example) - brightness: isLight ? Brightness.light : Brightness.dark, - // canvas Color - canvasColor: isLight ? LightThemeColors.canvasColor : DarkThemeColors.canvasColor, - // card widget background color - cardColor: isLight ? LightThemeColors.cardColor : DarkThemeColors.cardColor, - // hint text color - hintColor: isLight ? LightThemeColors.hintTextColor : DarkThemeColors.hintTextColor, - // divider color - dividerColor: isLight ? LightThemeColors.dividerColor : DarkThemeColors.dividerColor, - // app background color - backgroundColor: isLight ? LightThemeColors.backgroundColor : DarkThemeColors.backgroundColor, - scaffoldBackgroundColor: isLight ? LightThemeColors.scaffoldBackgroundColor : DarkThemeColors.scaffoldBackgroundColor, + useMaterial3: true, + // main color (app bar,tabs..etc) + primaryColor: isLight + ? LightThemeColors.primaryColor + : DarkThemeColors.primaryColor, + primaryColorLight: isLight + ? LightThemeColors.primaryColorLight + : DarkThemeColors.primaryColorLight, + primaryColorDark: isLight + ? LightThemeColors.primaryColorDark + : DarkThemeColors.primaryColorDark, + // secondary color (for checkbox,float button, radio..etc) + // accentColor: isLight ? LightThemeColors.accentColor : DarkThemeColors.accentColor, + // color contrast (if the theme is dark text should be white for example) + brightness: isLight ? Brightness.light : Brightness.dark, + // canvas Color + canvasColor: + isLight ? LightThemeColors.canvasColor : DarkThemeColors.canvasColor, + // card widget background color + cardColor: + isLight ? LightThemeColors.cardColor : DarkThemeColors.cardColor, + // hint text color + hintColor: isLight + ? LightThemeColors.hintTextColor + : DarkThemeColors.hintTextColor, + // divider color + dividerColor: isLight + ? LightThemeColors.dividerColor + : DarkThemeColors.dividerColor, + // app background color + // backgroundColor: isLight ? LightThemeColors.backgroundColor : DarkThemeColors.backgroundColor, + scaffoldBackgroundColor: isLight + ? LightThemeColors.scaffoldBackgroundColor + : DarkThemeColors.scaffoldBackgroundColor, - // progress bar theme - progressIndicatorTheme: ProgressIndicatorThemeData( - color: isLight ? LightThemeColors.primaryColor : DarkThemeColors.primaryColor, - ), + // progress bar theme + progressIndicatorTheme: ProgressIndicatorThemeData( + color: isLight + ? LightThemeColors.primaryColor + : DarkThemeColors.primaryColor, + ), - // appBar theme - appBarTheme: MyStyles.getAppBarTheme(isLightTheme: isLight), + // appBar theme + appBarTheme: MyStyles.getAppBarTheme(isLightTheme: isLight), - // elevated button theme - elevatedButtonTheme: MyStyles.getElevatedButtonTheme(isLightTheme: isLight), + // elevated button theme + elevatedButtonTheme: + MyStyles.getElevatedButtonTheme(isLightTheme: isLight), - // text theme - textTheme: MyStyles.getTextTheme(isLightTheme: isLight), + // text theme + textTheme: MyStyles.getTextTheme(isLightTheme: isLight), - // chip theme - chipTheme: MyStyles.getChipTheme(isLightTheme: isLight), + // chip theme + chipTheme: MyStyles.getChipTheme(isLightTheme: isLight), - // icon theme - iconTheme: MyStyles.getIconTheme(isLightTheme: isLight), + // icon theme + iconTheme: MyStyles.getIconTheme(isLightTheme: isLight), ); } @@ -65,4 +82,4 @@ class MyTheme { /// check if the theme is light or dark bool get getThemeIsLight => MySharedPref.getThemeIsLight(); -} \ No newline at end of file +} diff --git a/pubspec.lock b/pubspec.lock index ed2ee42..9f2379a 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,168 +5,192 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - url: "https://pub.dartlang.org" + sha256: ae92f5d747aee634b87f89d9946000c2de774be1d6ac3e58268224348cd0101a + url: "https://pub.dev" source: hosted - version: "47.0.0" + version: "61.0.0" analyzer: dependency: transitive description: name: analyzer - url: "https://pub.dartlang.org" + sha256: ea3d8652bda62982addfd92fdc2d0214e5f82e43325104990d4f4c4a2a313562 + url: "https://pub.dev" source: hosted - version: "4.7.0" + version: "5.13.0" archive: dependency: transitive description: name: archive - url: "https://pub.dartlang.org" + sha256: eb33140ede1b4039f4ad631f7bf3cfa58e24514e8bf87184bc32f17541af87fc + url: "https://pub.dev" source: hosted version: "3.3.0" args: dependency: transitive description: name: args - url: "https://pub.dartlang.org" + sha256: b003c3098049a51720352d219b0bb5f219b60fbfb68e7a4748139a06a5676515 + url: "https://pub.dev" source: hosted version: "2.3.1" async: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" source: hosted - version: "2.9.0" + version: "2.11.0" badges: dependency: "direct main" description: name: badges - url: "https://pub.dartlang.org" + sha256: "6e7f3ec561ec08f47f912cfe349d4a1707afdc8dda271e17b046aa6d42c89e77" + url: "https://pub.dev" source: hosted version: "3.1.1" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" build: dependency: transitive description: name: build - url: "https://pub.dartlang.org" + sha256: "3fbda25365741f8251b39f3917fb3c8e286a96fd068a5a242e11c2012d495777" + url: "https://pub.dev" source: hosted - version: "2.3.0" + version: "2.3.1" built_collection: dependency: transitive description: name: built_collection - url: "https://pub.dartlang.org" + sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100" + url: "https://pub.dev" source: hosted version: "5.1.1" built_value: dependency: transitive description: name: built_value - url: "https://pub.dartlang.org" + sha256: "46de9693ed8ef79e72d9775caf170b5ecae77d7355db49e3dd67de25db60847d" + url: "https://pub.dev" source: hosted version: "8.3.2" carousel_slider: dependency: "direct main" description: name: carousel_slider - url: "https://pub.dartlang.org" + sha256: "9c695cc963bf1d04a47bd6021f68befce8970bcd61d24938e1fb0918cf5d9c42" + url: "https://pub.dev" source: hosted version: "4.2.1" change_app_package_name: dependency: "direct main" description: name: change_app_package_name - url: "https://pub.dartlang.org" + sha256: f9ebaf68a4b5a68c581492579bb68273c523ef325fbf9ce2f1b57fb136ad023b + url: "https://pub.dev" source: hosted version: "1.1.0" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.3.0" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" source: hosted version: "1.1.1" code_builder: dependency: transitive description: name: code_builder - url: "https://pub.dartlang.org" + sha256: "1be9be30396d7e4c0db42c35ea6ccd7cc6a1e19916b5dc64d6ac216b5544d677" + url: "https://pub.dev" source: hosted - version: "4.4.0" + version: "4.7.0" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + url: "https://pub.dev" source: hosted - version: "1.16.0" + version: "1.17.2" convert: dependency: transitive description: name: convert - url: "https://pub.dartlang.org" + sha256: "196284f26f69444b7f5c50692b55ec25da86d9e500451dc09333bf2e3ad69259" + url: "https://pub.dev" source: hosted version: "3.0.2" crypto: dependency: transitive description: name: crypto - url: "https://pub.dartlang.org" + sha256: aa274aa7774f8964e4f4f38cc994db7b6158dd36e9187aaceaddc994b35c6c67 + url: "https://pub.dev" source: hosted version: "3.0.2" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - url: "https://pub.dartlang.org" + sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be + url: "https://pub.dev" source: hosted version: "1.0.5" dart_style: dependency: transitive description: name: dart_style - url: "https://pub.dartlang.org" + sha256: "1efa911ca7086affd35f463ca2fc1799584fb6aa89883cf0af8e3664d6a02d55" + url: "https://pub.dev" source: hosted - version: "2.2.3" + version: "2.3.2" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.dartlang.org" + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" source: hosted version: "1.3.1" ffi: dependency: transitive description: name: ffi - url: "https://pub.dartlang.org" + sha256: "13a6ccf6a459a125b3fcdb6ec73bd5ff90822e071207c663bfd1f70062d51d18" + url: "https://pub.dev" source: hosted version: "1.2.1" file: dependency: transitive description: name: file - url: "https://pub.dartlang.org" + sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" + url: "https://pub.dev" source: hosted - version: "6.1.2" + version: "6.1.4" fixnum: dependency: transitive description: name: fixnum - url: "https://pub.dartlang.org" + sha256: "04be3e934c52e082558cc9ee21f42f5c1cd7a1262f4c63cd0357c08d5bba81ec" + url: "https://pub.dev" source: hosted version: "1.0.1" flutter: @@ -178,7 +202,8 @@ packages: dependency: "direct main" description: name: flutter_animate - url: "https://pub.dartlang.org" + sha256: be54662837a6e66cc53ee88549e808c625275e0faf5a43e11cf3182cb0bd1b02 + url: "https://pub.dev" source: hosted version: "4.2.0" flutter_driver: @@ -190,28 +215,32 @@ packages: dependency: "direct main" description: name: flutter_launcher_icons - url: "https://pub.dartlang.org" + sha256: "559c600f056e7c704bd843723c21e01b5fba47e8824bd02422165bcc02a5de1d" + url: "https://pub.dev" source: hosted version: "0.9.3" flutter_lints: dependency: "direct dev" description: name: flutter_lints - url: "https://pub.dartlang.org" + sha256: b543301ad291598523947dc534aaddc5aaad597b709d2426d3a0e0d44c5cb493 + url: "https://pub.dev" source: hosted version: "1.0.4" flutter_screenutil: dependency: "direct main" description: name: flutter_screenutil - url: "https://pub.dartlang.org" + sha256: "8bc686a9e4db21d7e2c8a1761073f6dee088f3d8284a3ad812825bb398ae85a6" + url: "https://pub.dev" source: hosted version: "5.5.3+2" flutter_svg: dependency: "direct main" description: name: flutter_svg - url: "https://pub.dartlang.org" + sha256: c9bb2757b8a0bbf8e45f4069a90d2b9dbafc80b1a5e28d43e29088be533e6df4 + url: "https://pub.dev" source: hosted version: "1.0.3" flutter_test: @@ -233,21 +262,24 @@ packages: dependency: "direct main" description: name: get - url: "https://pub.dartlang.org" + sha256: "2ba20a47c8f1f233bed775ba2dd0d3ac97b4cf32fc17731b3dfc672b06b0e92a" + url: "https://pub.dev" source: hosted version: "4.6.5" glob: dependency: transitive description: name: glob - url: "https://pub.dartlang.org" + sha256: "8321dd2c0ab0683a91a51307fa844c6db4aa8e3981219b78961672aaab434658" + url: "https://pub.dev" source: hosted version: "2.0.2" image: dependency: transitive description: name: image - url: "https://pub.dartlang.org" + sha256: "02bafd3b4f399bfeb10034deba9753d93b55ce41cd0c4d3d8b355626f80e5b32" + url: "https://pub.dev" source: hosted version: "3.1.3" integration_test: @@ -255,200 +287,220 @@ packages: description: flutter source: sdk version: "0.0.0" - js: - dependency: transitive - description: - name: js - url: "https://pub.dartlang.org" - source: hosted - version: "0.6.4" lints: dependency: transitive description: name: lints - url: "https://pub.dartlang.org" + sha256: a2c3d198cb5ea2e179926622d433331d8b58374ab8f29cdda6e863bd62fd369c + url: "https://pub.dev" source: hosted version: "1.0.1" logging: dependency: transitive description: name: logging - url: "https://pub.dartlang.org" + sha256: "293ae2d49fd79d4c04944c3a26dfd313382d5f52e821ec57119230ae16031ad4" + url: "https://pub.dev" source: hosted version: "1.0.2" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" + url: "https://pub.dev" source: hosted - version: "0.12.12" + version: "0.12.16" material_color_utilities: dependency: transitive description: name: material_color_utilities - url: "https://pub.dartlang.org" + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" + url: "https://pub.dev" source: hosted - version: "0.1.5" + version: "0.5.0" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.9.1" mockito: dependency: "direct dev" description: name: mockito - url: "https://pub.dartlang.org" + sha256: "7d5b53bcd556c1bc7ffbe4e4d5a19c3e112b7e925e9e172dd7c6ad0630812616" + url: "https://pub.dev" source: hosted - version: "5.3.2" + version: "5.4.2" package_config: dependency: transitive description: name: package_config - url: "https://pub.dartlang.org" + sha256: a4d5ede5ca9c3d88a2fef1147a078570c861714c806485c596b109819135bc12 + url: "https://pub.dev" source: hosted version: "2.0.2" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + url: "https://pub.dev" source: hosted - version: "1.8.2" + version: "1.8.3" path_drawing: dependency: transitive description: name: path_drawing - url: "https://pub.dartlang.org" + sha256: bbb1934c0cbb03091af082a6389ca2080345291ef07a5fa6d6e078ba8682f977 + url: "https://pub.dev" source: hosted version: "1.0.1" path_parsing: dependency: transitive description: name: path_parsing - url: "https://pub.dartlang.org" + sha256: e3e67b1629e6f7e8100b367d3db6ba6af4b1f0bb80f64db18ef1fbabd2fa9ccf + url: "https://pub.dev" source: hosted version: "1.0.1" path_provider_linux: dependency: transitive description: name: path_provider_linux - url: "https://pub.dartlang.org" + sha256: ab0987bf95bc591da42dffb38c77398fc43309f0b9b894dcc5d6f40c4b26c379 + url: "https://pub.dev" source: hosted version: "2.1.7" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface - url: "https://pub.dartlang.org" + sha256: "27dc7a224fcd07444cb5e0e60423ccacea3e13cf00fc5282ac2c918132da931d" + url: "https://pub.dev" source: hosted version: "2.0.4" path_provider_windows: dependency: transitive description: name: path_provider_windows - url: "https://pub.dartlang.org" + sha256: a34ecd7fb548f8e57321fd8e50d865d266941b54e6c3b7758cf8f37c24116905 + url: "https://pub.dev" source: hosted version: "2.0.7" petitparser: dependency: transitive description: name: petitparser - url: "https://pub.dartlang.org" + sha256: "1a914995d4ef10c94ff183528c120d35ed43b5eaa8713fc6766a9be4570782e2" + url: "https://pub.dev" source: hosted version: "4.4.0" platform: dependency: transitive description: name: platform - url: "https://pub.dartlang.org" + sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76" + url: "https://pub.dev" source: hosted version: "3.1.0" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - url: "https://pub.dartlang.org" + sha256: "075f927ebbab4262ace8d0b283929ac5410c0ac4e7fc123c76429564facfb757" + url: "https://pub.dev" source: hosted version: "2.1.2" process: dependency: transitive description: name: process - url: "https://pub.dartlang.org" + sha256: "53fd8db9cec1d37b0574e12f07520d582019cb6c44abf5479a01505099a34a09" + url: "https://pub.dev" source: hosted version: "4.2.4" pub_semver: dependency: transitive description: name: pub_semver - url: "https://pub.dartlang.org" + sha256: "816c1a640e952d213ddd223b3e7aafae08cd9f8e1f6864eed304cc13b0272b07" + url: "https://pub.dev" source: hosted version: "2.1.1" rename_app: dependency: "direct main" description: name: rename_app - url: "https://pub.dartlang.org" + sha256: "9db1121f65843e27f4e7a2ee3bef54d8cb6bc35fca5e5bda405be2a9e41e983b" + url: "https://pub.dev" source: hosted version: "1.1.0" shared_preferences: dependency: "direct main" description: name: shared_preferences - url: "https://pub.dartlang.org" + sha256: "76917b7d4b9526b2ba416808a7eb9fb2863c1a09cf63ec85f1453da240fa818a" + url: "https://pub.dev" source: hosted version: "2.0.15" shared_preferences_android: dependency: transitive description: name: shared_preferences_android - url: "https://pub.dartlang.org" + sha256: "8e251f3c986002b65fed6396bce81f379fb63c27317d49743cf289fd0fd1ab97" + url: "https://pub.dev" source: hosted version: "2.0.14" shared_preferences_ios: dependency: transitive description: name: shared_preferences_ios - url: "https://pub.dartlang.org" + sha256: "585a14cefec7da8c9c2fb8cd283a3bb726b4155c0952afe6a0caaa7b2272de34" + url: "https://pub.dev" source: hosted version: "2.1.1" shared_preferences_linux: dependency: transitive description: name: shared_preferences_linux - url: "https://pub.dartlang.org" + sha256: fbc3cd6826896b66a5f576b025e4f344f780c84ea7f8203097a353370607a2c8 + url: "https://pub.dev" source: hosted version: "2.1.2" shared_preferences_macos: dependency: transitive description: name: shared_preferences_macos - url: "https://pub.dartlang.org" + sha256: fbb94bf296576f49be37a1496d5951796211a8db0aa22cc0d68c46440dad808c + url: "https://pub.dev" source: hosted version: "2.0.4" shared_preferences_platform_interface: dependency: transitive description: name: shared_preferences_platform_interface - url: "https://pub.dartlang.org" + sha256: da9431745ede5ece47bc26d5d73a9d3c6936ef6945c101a5aca46f62e52c1cf3 + url: "https://pub.dev" source: hosted version: "2.1.0" shared_preferences_web: dependency: transitive description: name: shared_preferences_web - url: "https://pub.dartlang.org" + sha256: a4b5bc37fe1b368bbc81f953197d55e12f49d0296e7e412dfe2d2d77d6929958 + url: "https://pub.dev" source: hosted version: "2.0.4" shared_preferences_windows: dependency: transitive description: name: shared_preferences_windows - url: "https://pub.dartlang.org" + sha256: "07c274c2115d4d5e4280622abb09f0980e2c5b1fcdc98ae9f59a3bad5bfc1f26" + url: "https://pub.dev" source: hosted version: "2.1.2" sky_engine: @@ -460,121 +512,146 @@ packages: dependency: transitive description: name: source_gen - url: "https://pub.dartlang.org" + sha256: fc0da689e5302edb6177fdd964efcb7f58912f43c28c2047a808f5bfff643d16 + url: "https://pub.dev" source: hosted - version: "1.2.2" + version: "1.4.0" source_span: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" source: hosted - version: "1.9.0" + version: "1.10.0" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.2.0" sync_http: dependency: transitive description: name: sync_http - url: "https://pub.dartlang.org" + sha256: "7f0cd72eca000d2e026bcd6f990b81d0ca06022ef4e32fb257b30d3d1014a961" + url: "https://pub.dev" source: hosted version: "0.3.1" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted version: "1.2.1" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" + url: "https://pub.dev" source: hosted - version: "0.4.12" + version: "0.6.0" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.dartlang.org" + sha256: "26f87ade979c47a150c9eaab93ccd2bebe70a27dc0b4b29517f2904f04eb11a5" + url: "https://pub.dev" source: hosted version: "1.3.1" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.4" vm_service: dependency: transitive description: name: vm_service - url: "https://pub.dartlang.org" + sha256: c620a6f783fa22436da68e42db7ebbf18b8c44b9a46ab911f666ff09ffd9153f + url: "https://pub.dev" source: hosted - version: "9.0.0" + version: "11.7.1" watcher: dependency: transitive description: name: watcher - url: "https://pub.dartlang.org" + sha256: e42dfcc48f67618344da967b10f62de57e04bae01d9d3af4c2596f3712a88c99 + url: "https://pub.dev" source: hosted version: "1.0.1" + web: + dependency: transitive + description: + name: web + sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + url: "https://pub.dev" + source: hosted + version: "0.1.4-beta" webdriver: dependency: transitive description: name: webdriver - url: "https://pub.dartlang.org" + sha256: "3c923e918918feeb90c4c9fdf1fe39220fa4c0e8e2c0fffaded174498ef86c49" + url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "3.0.2" win32: dependency: transitive description: name: win32 - url: "https://pub.dartlang.org" + sha256: "4658d864d83cdaedcbf3e65ad93b71880a3e8c9ee1ff15d855f88fb2da66cb8a" + url: "https://pub.dev" source: hosted version: "2.5.2" xdg_directories: dependency: transitive description: name: xdg_directories - url: "https://pub.dartlang.org" + sha256: "060b6e1c891d956f72b5ac9463466c37cce3fa962a921532fc001e86fe93438e" + url: "https://pub.dev" source: hosted version: "0.2.0+1" xml: dependency: transitive description: name: xml - url: "https://pub.dartlang.org" + sha256: baa23bcba1ba4ce4b22c0c7a1d9c861e7015cb5169512676da0b85138e72840c + url: "https://pub.dev" source: hosted version: "5.3.1" yaml: dependency: transitive description: name: yaml - url: "https://pub.dartlang.org" + sha256: "23812a9b125b48d4007117254bca50abb6c712352927eece9e155207b1db2370" + url: "https://pub.dev" source: hosted version: "3.1.1" sdks: - dart: ">=2.17.0 <3.0.0" + dart: ">=3.1.0-185.0.dev <4.0.0" flutter: ">=2.10.0" From 1981c40b0ead2525bc3c1feb8851c27ff8708a42 Mon Sep 17 00:00:00 2001 From: shivamchauhan29 Date: Sun, 22 Oct 2023 10:30:29 +0530 Subject: [PATCH 2/3] updated versions --- lib/app/modules/base/views/base_view.dart | 7 +- lib/app/modules/cart/views/cart_view.dart | 2 + lib/app/modules/home/views/home_view.dart | 2 + .../views/product_details_view.dart | 2 + .../modules/products/views/products_view.dart | 2 + pubspec.lock | 166 +++++++++++------- pubspec.yaml | 22 +-- 7 files changed, 132 insertions(+), 71 deletions(-) diff --git a/lib/app/modules/base/views/base_view.dart b/lib/app/modules/base/views/base_view.dart index 7331b6f..41663b8 100644 --- a/lib/app/modules/base/views/base_view.dart +++ b/lib/app/modules/base/views/base_view.dart @@ -1,3 +1,5 @@ +// ignore_for_file: deprecated_member_use + import 'package:badges/badges.dart' as badges; import 'package:badges/badges.dart'; import 'package:flutter/material.dart'; @@ -106,7 +108,10 @@ class BaseView extends GetView { _mBottomNavItem({required String label, required String icon}) { return BottomNavigationBarItem( label: label, - icon: SvgPicture.asset(icon, color: Get.theme.iconTheme.color), + icon: SvgPicture.asset( + icon, + color: Colors.grey.withOpacity(0.5), + ), activeIcon: SvgPicture.asset(icon, color: Get.theme.appBarTheme.iconTheme?.color), ); diff --git a/lib/app/modules/cart/views/cart_view.dart b/lib/app/modules/cart/views/cart_view.dart index cdb1071..888277e 100644 --- a/lib/app/modules/cart/views/cart_view.dart +++ b/lib/app/modules/cart/views/cart_view.dart @@ -1,3 +1,5 @@ +// ignore_for_file: deprecated_member_use + import 'package:flutter/material.dart'; import 'package:flutter_animate/flutter_animate.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; diff --git a/lib/app/modules/home/views/home_view.dart b/lib/app/modules/home/views/home_view.dart index 666ec28..6f4d7fd 100644 --- a/lib/app/modules/home/views/home_view.dart +++ b/lib/app/modules/home/views/home_view.dart @@ -1,3 +1,5 @@ +// ignore_for_file: deprecated_member_use + import 'package:flutter/material.dart'; import 'package:carousel_slider/carousel_slider.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; diff --git a/lib/app/modules/product_details/views/product_details_view.dart b/lib/app/modules/product_details/views/product_details_view.dart index 01c318e..7338b82 100644 --- a/lib/app/modules/product_details/views/product_details_view.dart +++ b/lib/app/modules/product_details/views/product_details_view.dart @@ -1,3 +1,5 @@ +// ignore_for_file: deprecated_member_use + import 'package:flutter/material.dart'; import 'package:flutter_animate/flutter_animate.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; diff --git a/lib/app/modules/products/views/products_view.dart b/lib/app/modules/products/views/products_view.dart index 69caac8..1b5978d 100644 --- a/lib/app/modules/products/views/products_view.dart +++ b/lib/app/modules/products/views/products_view.dart @@ -1,3 +1,5 @@ +// ignore_for_file: deprecated_member_use + import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_svg/flutter_svg.dart'; diff --git a/pubspec.lock b/pubspec.lock index 9f2379a..24598d1 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -21,18 +21,18 @@ packages: dependency: transitive description: name: archive - sha256: eb33140ede1b4039f4ad631f7bf3cfa58e24514e8bf87184bc32f17541af87fc + sha256: "20071638cbe4e5964a427cfa0e86dce55d060bc7d82d56f3554095d7239a8765" url: "https://pub.dev" source: hosted - version: "3.3.0" + version: "3.4.2" args: dependency: transitive description: name: args - sha256: b003c3098049a51720352d219b0bb5f219b60fbfb68e7a4748139a06a5676515 + sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 url: "https://pub.dev" source: hosted - version: "2.3.1" + version: "2.4.2" async: dependency: transitive description: @@ -45,10 +45,10 @@ packages: dependency: "direct main" description: name: badges - sha256: "6e7f3ec561ec08f47f912cfe349d4a1707afdc8dda271e17b046aa6d42c89e77" + sha256: a7b6bbd60dce418df0db3058b53f9d083c22cdb5132a052145dc267494df0b84 url: "https://pub.dev" source: hosted - version: "3.1.1" + version: "3.1.2" boolean_selector: dependency: transitive description: @@ -105,6 +105,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.0" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff + url: "https://pub.dev" + source: hosted + version: "2.0.3" + cli_util: + dependency: transitive + description: + name: cli_util + sha256: b8db3080e59b2503ca9e7922c3df2072cf13992354d5e944074ffa836fba43b7 + url: "https://pub.dev" + source: hosted + version: "0.4.0" clock: dependency: transitive description: @@ -149,10 +165,10 @@ packages: dependency: "direct main" description: name: cupertino_icons - sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be + sha256: d57953e10f9f8327ce64a508a355f0b1ec902193f66288e8cb5070e7c47eeb2d url: "https://pub.dev" source: hosted - version: "1.0.5" + version: "1.0.6" dart_style: dependency: transitive description: @@ -202,10 +218,10 @@ packages: dependency: "direct main" description: name: flutter_animate - sha256: be54662837a6e66cc53ee88549e808c625275e0faf5a43e11cf3182cb0bd1b02 + sha256: "62f346340a96192070e31e3f2a1bd30a28530f1fe8be978821e06cd56b74d6d2" url: "https://pub.dev" source: hosted - version: "4.2.0" + version: "4.2.0+1" flutter_driver: dependency: transitive description: flutter @@ -215,10 +231,10 @@ packages: dependency: "direct main" description: name: flutter_launcher_icons - sha256: "559c600f056e7c704bd843723c21e01b5fba47e8824bd02422165bcc02a5de1d" + sha256: "526faf84284b86a4cb36d20a5e45147747b7563d921373d4ee0559c54fcdbcea" url: "https://pub.dev" source: hosted - version: "0.9.3" + version: "0.13.1" flutter_lints: dependency: "direct dev" description: @@ -231,18 +247,18 @@ packages: dependency: "direct main" description: name: flutter_screenutil - sha256: "8bc686a9e4db21d7e2c8a1761073f6dee088f3d8284a3ad812825bb398ae85a6" + sha256: "8cf100b8e4973dc570b6415a2090b0bfaa8756ad333db46939efc3e774ee100d" url: "https://pub.dev" source: hosted - version: "5.5.3+2" + version: "5.9.0" flutter_svg: dependency: "direct main" description: name: flutter_svg - sha256: c9bb2757b8a0bbf8e45f4069a90d2b9dbafc80b1a5e28d43e29088be533e6df4 + sha256: "8c5d68a82add3ca76d792f058b186a0599414f279f00ece4830b9b231b570338" url: "https://pub.dev" source: hosted - version: "1.0.3" + version: "2.0.7" flutter_test: dependency: "direct dev" description: flutter @@ -262,10 +278,10 @@ packages: dependency: "direct main" description: name: get - sha256: "2ba20a47c8f1f233bed775ba2dd0d3ac97b4cf32fc17731b3dfc672b06b0e92a" + sha256: e4e7335ede17452b391ed3b2ede016545706c01a02292a6c97619705e7d2a85e url: "https://pub.dev" source: hosted - version: "4.6.5" + version: "4.6.6" glob: dependency: transitive description: @@ -278,15 +294,31 @@ packages: dependency: transitive description: name: image - sha256: "02bafd3b4f399bfeb10034deba9753d93b55ce41cd0c4d3d8b355626f80e5b32" + sha256: "028f61960d56f26414eb616b48b04eb37d700cbe477b7fb09bf1d7ce57fd9271" url: "https://pub.dev" source: hosted - version: "3.1.3" + version: "4.1.3" integration_test: dependency: "direct dev" description: flutter source: sdk version: "0.0.0" + js: + dependency: transitive + description: + name: js + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" + source: hosted + version: "0.6.7" + json_annotation: + dependency: transitive + description: + name: json_annotation + sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467 + url: "https://pub.dev" + source: hosted + version: "4.8.1" lints: dependency: transitive description: @@ -351,14 +383,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.8.3" - path_drawing: - dependency: transitive - description: - name: path_drawing - sha256: bbb1934c0cbb03091af082a6389ca2080345291ef07a5fa6d6e078ba8682f977 - url: "https://pub.dev" - source: hosted - version: "1.0.1" path_parsing: dependency: transitive description: @@ -395,10 +419,10 @@ packages: dependency: transitive description: name: petitparser - sha256: "1a914995d4ef10c94ff183528c120d35ed43b5eaa8713fc6766a9be4570782e2" + sha256: cb3798bef7fc021ac45b308f4b51208a152792445cce0448c9a4ba5879dd8750 url: "https://pub.dev" source: hosted - version: "4.4.0" + version: "5.4.0" platform: dependency: transitive description: @@ -415,6 +439,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.2" + pointycastle: + dependency: transitive + description: + name: pointycastle + sha256: "7c1e5f0d23c9016c5bbd8b1473d0d3fb3fc851b876046039509e18e0c7485f2c" + url: "https://pub.dev" + source: hosted + version: "3.7.3" process: dependency: transitive description: @@ -435,74 +467,66 @@ packages: dependency: "direct main" description: name: rename_app - sha256: "9db1121f65843e27f4e7a2ee3bef54d8cb6bc35fca5e5bda405be2a9e41e983b" + sha256: "598d33d1a89c7f47e57b6f37edb9661667238e49a9a81cf4e60a8cf444a3f9fc" url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.3.1" shared_preferences: dependency: "direct main" description: name: shared_preferences - sha256: "76917b7d4b9526b2ba416808a7eb9fb2863c1a09cf63ec85f1453da240fa818a" + sha256: "81429e4481e1ccfb51ede496e916348668fd0921627779233bd24cc3ff6abd02" url: "https://pub.dev" source: hosted - version: "2.0.15" + version: "2.2.2" shared_preferences_android: dependency: transitive description: name: shared_preferences_android - sha256: "8e251f3c986002b65fed6396bce81f379fb63c27317d49743cf289fd0fd1ab97" + sha256: "8568a389334b6e83415b6aae55378e158fbc2314e074983362d20c562780fb06" url: "https://pub.dev" source: hosted - version: "2.0.14" - shared_preferences_ios: + version: "2.2.1" + shared_preferences_foundation: dependency: transitive description: - name: shared_preferences_ios - sha256: "585a14cefec7da8c9c2fb8cd283a3bb726b4155c0952afe6a0caaa7b2272de34" + name: shared_preferences_foundation + sha256: "7bf53a9f2d007329ee6f3df7268fd498f8373602f943c975598bbb34649b62a7" url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.3.4" shared_preferences_linux: dependency: transitive description: name: shared_preferences_linux - sha256: fbc3cd6826896b66a5f576b025e4f344f780c84ea7f8203097a353370607a2c8 - url: "https://pub.dev" - source: hosted - version: "2.1.2" - shared_preferences_macos: - dependency: transitive - description: - name: shared_preferences_macos - sha256: fbb94bf296576f49be37a1496d5951796211a8db0aa22cc0d68c46440dad808c + sha256: "9f2cbcf46d4270ea8be39fa156d86379077c8a5228d9dfdb1164ae0bb93f1faa" url: "https://pub.dev" source: hosted - version: "2.0.4" + version: "2.3.2" shared_preferences_platform_interface: dependency: transitive description: name: shared_preferences_platform_interface - sha256: da9431745ede5ece47bc26d5d73a9d3c6936ef6945c101a5aca46f62e52c1cf3 + sha256: d4ec5fc9ebb2f2e056c617112aa75dcf92fc2e4faaf2ae999caa297473f75d8a url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.3.1" shared_preferences_web: dependency: transitive description: name: shared_preferences_web - sha256: a4b5bc37fe1b368bbc81f953197d55e12f49d0296e7e412dfe2d2d77d6929958 + sha256: d762709c2bbe80626ecc819143013cc820fa49ca5e363620ee20a8b15a3e3daf url: "https://pub.dev" source: hosted - version: "2.0.4" + version: "2.2.1" shared_preferences_windows: dependency: transitive description: name: shared_preferences_windows - sha256: "07c274c2115d4d5e4280622abb09f0980e2c5b1fcdc98ae9f59a3bad5bfc1f26" + sha256: "841ad54f3c8381c480d0c9b508b89a34036f512482c407e6df7a9c4aa2ef8f59" url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.3.2" sky_engine: dependency: transitive description: flutter @@ -580,6 +604,30 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.1" + vector_graphics: + dependency: transitive + description: + name: vector_graphics + sha256: b16dadf7eb610e20da044c141b4a0199a5e8082ca21daba68322756f953ce714 + url: "https://pub.dev" + source: hosted + version: "1.1.9" + vector_graphics_codec: + dependency: transitive + description: + name: vector_graphics_codec + sha256: a4b01403d5c613db115e30e71eca33f7e9e09f2d3c52c3fb84e16333ecddc539 + url: "https://pub.dev" + source: hosted + version: "1.1.9" + vector_graphics_compiler: + dependency: transitive + description: + name: vector_graphics_compiler + sha256: d26c0e2f237476426523eb25512e4c09fa27c6d33ed659a0e69d79e20b5dc47f + url: "https://pub.dev" + source: hosted + version: "1.1.9" vector_math: dependency: transitive description: @@ -640,10 +688,10 @@ packages: dependency: transitive description: name: xml - sha256: baa23bcba1ba4ce4b22c0c7a1d9c861e7015cb5169512676da0b85138e72840c + sha256: "5bc72e1e45e941d825fd7468b9b4cc3b9327942649aeb6fc5cdbf135f0a86e84" url: "https://pub.dev" source: hosted - version: "5.3.1" + version: "6.3.0" yaml: dependency: transitive description: @@ -654,4 +702,4 @@ packages: version: "3.1.1" sdks: dart: ">=3.1.0-185.0.dev <4.0.0" - flutter: ">=2.10.0" + flutter: ">=3.13.0" diff --git a/pubspec.yaml b/pubspec.yaml index 97c2bdd..05308b8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -6,17 +6,17 @@ environment: sdk: '>=2.16.0 <3.0.0' dependencies: - cupertino_icons: - get: # for state management and context less stuff - flutter_screenutil: # make app responsive - shared_preferences: # shared preferences persistence key value store - flutter_launcher_icons: # change app icon - change_app_package_name: # change package name - rename_app: # rename app - flutter_svg: # for svg icons - carousel_slider: # for image slider - badges: # for badges - flutter_animate: # for animation + cupertino_icons: ^1.0.6 + get: ^4.6.6 # for state management and context less stuff + flutter_screenutil: ^5.9.0 # make app responsive + shared_preferences: ^2.2.2 # shared preferences persistence key value store + flutter_launcher_icons: ^0.13.1 # change app icon + change_app_package_name: ^1.1.0 # change package name + rename_app: ^1.3.1 # rename app + flutter_svg: ^2.0.7 # for svg icons + carousel_slider: ^4.2.1 # for image slider + badges: ^3.1.2 # for badges + flutter_animate: ^4.2.0+1 # for animation flutter: sdk: flutter From bf6382918bc39fe45070245e4bf141065dc3c166 Mon Sep 17 00:00:00 2001 From: shivamchauhan29 Date: Tue, 24 Oct 2023 18:39:33 +0530 Subject: [PATCH 3/3] updated --- 0 | 0 android/build.gradle | 5 +++-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 0 diff --git a/0 b/0 new file mode 100644 index 0000000..e69de29 diff --git a/android/build.gradle b/android/build.gradle index 0a2d6a1..63512ec 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,12 +1,13 @@ buildscript { - ext.kotlin_version = '1.6.10' + ext.kotlin_version = '1.9.10' repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:4.1.0' + classpath 'com.android.tools.build:gradle:7.4.2' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } }