diff --git a/android/app/build.gradle b/android/app/build.gradle index 983ee05..ba907a1 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -46,10 +46,7 @@ android { } defaultConfig { - // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.webkul.bagisto.mobikul" - // You can update the following values to match your application needs. - // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. minSdkVersion 22 targetSdkVersion 33 versionCode flutterVersionCode.toInteger() @@ -58,8 +55,6 @@ android { buildTypes { release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. signingConfig signingConfigs.debug } } @@ -75,17 +70,11 @@ dependencies { implementation 'com.facebook.android:facebook-android-sdk:8.2.0' implementation 'com.google.ar.sceneform.ux:sceneform-ux:1.17.1' - // ML KIT api 'com.google.android.gms:play-services-mlkit-text-recognition:18.0.0' api 'com.google.mlkit:image-labeling:17.0.7' - // Image labeling custom api 'com.google.mlkit:image-labeling-custom:17.0.1' - //===Ar Core - implementation "com.google.ar.sceneform.ux:sceneform-ux:1.17.1" - // implementation "com.google.ar.sceneform:core:1.17.1" implementation 'com.google.ar.sceneform:assets:1.17.1' implementation "com.google.ar:core:1.30.0" - //---------------------------------------// implementation 'androidx.recyclerview:recyclerview:1.2.1' implementation 'androidx.appcompat:appcompat:1.4.1' implementation 'com.github.bumptech.glide:glide:4.12.0' diff --git a/lib/data_model/order_model/order_detail_model.dart b/lib/data_model/order_model/order_detail_model.dart index 9e606a8..88b57b8 100644 --- a/lib/data_model/order_model/order_detail_model.dart +++ b/lib/data_model/order_model/order_detail_model.dart @@ -24,6 +24,7 @@ class OrderDetailModel extends GraphQlBaseModel { factory OrderDetailModel.fromJson(Map json) => _$OrderDetailModelFromJson(json); + @override Map toJson() => _$OrderDetailModelToJson(this); } @@ -179,6 +180,7 @@ class OrderDetail extends GraphQlBaseErrorModel { factory OrderDetail.fromJson(Map json) => _$OrderDetailFromJson(json); + @override Map toJson() => _$OrderDetailToJson(this); } diff --git a/lib/screens/add_edit_address/view/add_edit_address_screen.dart b/lib/screens/add_edit_address/view/add_edit_address_screen.dart index 853c648..32586cc 100644 --- a/lib/screens/add_edit_address/view/add_edit_address_screen.dart +++ b/lib/screens/add_edit_address/view/add_edit_address_screen.dart @@ -480,8 +480,8 @@ class _AddNewAddressState extends State elevation: 0.0, height: 48, minWidth: MediaQuery.of(context).size.width, - color: Theme.of(context).colorScheme.background, - textColor: Theme.of(context).colorScheme.onBackground, + color: Theme.of(context).colorScheme.surface, + textColor: Theme.of(context).colorScheme.onSurface, onPressed: () { _onPressSaveButton(); }, diff --git a/lib/screens/add_review/view/add_review.dart b/lib/screens/add_review/view/add_review.dart index 9cf80bc..ae3ba11 100644 --- a/lib/screens/add_review/view/add_review.dart +++ b/lib/screens/add_review/view/add_review.dart @@ -118,8 +118,8 @@ class _AddReviewState extends State { images.clear(); if(image != null){ images.add({ - "uploadType": '\"base64\"', - "imageUrl": '\"data:image/png;base64,$image\"' + "uploadType": '"base64"', + "imageUrl": '"data:image/png;base64,$image"' }); } return _reviewForm(); @@ -244,7 +244,7 @@ class _AddReviewState extends State { elevation: 0.0, height: AppSizes.buttonHeight, minWidth: MediaQuery.of(context).size.width, - color: Theme.of(context).colorScheme.onBackground, + color: Theme.of(context).colorScheme.onSurface, textColor: MobikulTheme.primaryColor, onPressed: () { _onPressSubmitButton(); diff --git a/lib/screens/address_list/view/widget/add_new_address_button.dart b/lib/screens/address_list/view/widget/add_new_address_button.dart index 360675e..ad87cb2 100644 --- a/lib/screens/address_list/view/widget/add_new_address_button.dart +++ b/lib/screens/address_list/view/widget/add_new_address_button.dart @@ -34,7 +34,7 @@ class AddNewAddressButton extends StatelessWidget { : Padding( padding: const EdgeInsets.all(8.0), child: MaterialButton( - color: Theme.of(context).colorScheme.onBackground, + color: Theme.of(context).colorScheme.onSurface, padding: const EdgeInsets.all(AppSizes.spacingMedium), onPressed: () { Navigator.pushNamed(context, addAddressScreen, @@ -56,7 +56,7 @@ class AddNewAddressButton extends StatelessWidget { ), Text( StringConstants.addNewAddress.localized().toUpperCase(), - style: TextStyle(color: Theme.of(context).colorScheme.background), + style: TextStyle(color: Theme.of(context).colorScheme.surface), ) ], ), diff --git a/lib/screens/address_list/view/widget/saved_address_list.dart b/lib/screens/address_list/view/widget/saved_address_list.dart index 05781d4..75c5731 100644 --- a/lib/screens/address_list/view/widget/saved_address_list.dart +++ b/lib/screens/address_list/view/widget/saved_address_list.dart @@ -211,15 +211,7 @@ class SavedAddressList extends StatelessWidget { return Padding( padding: const EdgeInsets.fromLTRB(AppSizes.spacingMedium, 0, 0, 0), child: Text( - ("${addressModel?.address1!.replaceAll("[", "").replaceAll("]", "") ?? ""}") + - "," + - (" ${addressModel?.city ?? ""}") + - "," + - (" ${addressModel?.stateName ?? (addressModel?.state ?? "")}") + - "," + - (" ${addressModel?.countryName ?? ""}") + - "," + - (" ${addressModel?.postcode ?? ""}"), + "${addressModel?.address1!.replaceAll("[", "").replaceAll("]", "") ?? ""}, ${addressModel?.city ?? ""}, ${addressModel?.stateName ?? (addressModel?.state ?? "")}, ${addressModel?.countryName ?? ""}, ${addressModel?.postcode ?? ""}", style: TextStyle( fontSize: AppSizes.spacingLarge, color: Colors.grey[600]), ), diff --git a/lib/screens/categories_screen/categories_screen.dart b/lib/screens/categories_screen/categories_screen.dart index e0cfeac..895f904 100644 --- a/lib/screens/categories_screen/categories_screen.dart +++ b/lib/screens/categories_screen/categories_screen.dart @@ -64,7 +64,7 @@ class _SubCategoryScreenState extends State { @override void initState() { - filters.add({"key": '\"category_id\"', "value": '\"${widget.id}\"'}); + filters.add({"key": '"category_id"', "value": '"${widget.id}"'}); _fetchSharedPreferenceData(); getSharePreferenceCartCount().then((value) { diff --git a/lib/screens/checkout/checkout_addres/view/widget/billing_shipping_address_view.dart b/lib/screens/checkout/checkout_addres/view/widget/billing_shipping_address_view.dart index e44c229..6e132e2 100644 --- a/lib/screens/checkout/checkout_addres/view/widget/billing_shipping_address_view.dart +++ b/lib/screens/checkout/checkout_addres/view/widget/billing_shipping_address_view.dart @@ -3,7 +3,6 @@ import 'package:flutter/material.dart'; import '../../../../../../data_model/app_route_arguments.dart'; import '../../../../../../utils/assets_constants.dart'; import '../../../../address_list/data_model/address_model.dart'; -import '../../bloc/checkout_bloc.dart'; // ignore: must_be_immutable class BillingAndShippingAddressView extends StatefulWidget { diff --git a/lib/screens/checkout/checkout_addres/view/widget/checkout_address_list.dart b/lib/screens/checkout/checkout_addres/view/widget/checkout_address_list.dart index 701a2d6..f06ea95 100644 --- a/lib/screens/checkout/checkout_addres/view/widget/checkout_address_list.dart +++ b/lib/screens/checkout/checkout_addres/view/widget/checkout_address_list.dart @@ -9,12 +9,7 @@ */ import 'package:bagisto_app_demo/screens/cart_screen/cart_index.dart'; -import 'package:bagisto_app_demo/utils/application_localization.dart'; import 'package:bagisto_app_demo/widgets/loader.dart'; -import 'package:flutter/material.dart'; -import '../../../../../../utils/app_constants.dart'; -import '../../../../../../utils/app_global_data.dart'; -import '../../../../../utils/string_constants.dart'; import '../../../../address_list/data_model/address_model.dart'; import '../../bloc/checkout_address_state.dart'; import '../../bloc/checkout_base_event.dart'; diff --git a/lib/screens/checkout/checkout_review/view/widget/apply_coupon_code.dart b/lib/screens/checkout/checkout_review/view/widget/apply_coupon_code.dart index 06d31be..a08516b 100644 --- a/lib/screens/checkout/checkout_review/view/widget/apply_coupon_code.dart +++ b/lib/screens/checkout/checkout_review/view/widget/apply_coupon_code.dart @@ -95,7 +95,7 @@ class _ApplyCouponCodeState extends State { right: 3), child: MaterialButton( height: 47, - color: Theme.of(context).colorScheme.onBackground, + color: Theme.of(context).colorScheme.onSurface, textColor: MobikulTheme.primaryColor, elevation: 0.0, shape: RoundedRectangleBorder( diff --git a/lib/screens/checkout/checkout_save_order/view/save_order.dart b/lib/screens/checkout/checkout_save_order/view/save_order.dart index 83b288c..06d258d 100644 --- a/lib/screens/checkout/checkout_save_order/view/save_order.dart +++ b/lib/screens/checkout/checkout_save_order/view/save_order.dart @@ -173,9 +173,9 @@ class _CheckOutSaveOrderState extends State { height: AppSizes.spacingMedium, ), MaterialButton( - color: Theme.of(context).colorScheme.onBackground, + color: Theme.of(context).colorScheme.onSurface, elevation: 0.0, - textColor: Theme.of(context).colorScheme.background, + textColor: Theme.of(context).colorScheme.surface, onPressed: () { Navigator.pushReplacementNamed(context, home); }, @@ -184,7 +184,7 @@ class _CheckOutSaveOrderState extends State { .localized() .toUpperCase(), style: Theme.of(context).textTheme.labelMedium?.copyWith( - color: Theme.of(context).colorScheme.background + color: Theme.of(context).colorScheme.surface ), ), ), diff --git a/lib/screens/checkout/checkout_shipping/view/checkout_shipping_view.dart b/lib/screens/checkout/checkout_shipping/view/checkout_shipping_view.dart index 4a27068..dff9fb2 100644 --- a/lib/screens/checkout/checkout_shipping/view/checkout_shipping_view.dart +++ b/lib/screens/checkout/checkout_shipping/view/checkout_shipping_view.dart @@ -195,9 +195,7 @@ class _CheckoutShippingPageViewState extends State { key: const Key('Shipping'), labels: checkOutSaveAddressModel.shippingMethods ?.map((e) => - (e.title ?? '') + - ' ' + - (e.methods?.formattedPrice.toString() ?? '')) + '${e.title ?? ''} ${e.methods?.formattedPrice.toString() ?? ''}') .toList() ?? [], onChange: (value, index) { diff --git a/lib/screens/checkout/guest_add_address/view/guest_add_address_form.dart b/lib/screens/checkout/guest_add_address/view/guest_add_address_form.dart index 0fbde28..4891900 100644 --- a/lib/screens/checkout/guest_add_address/view/guest_add_address_form.dart +++ b/lib/screens/checkout/guest_add_address/view/guest_add_address_form.dart @@ -340,7 +340,7 @@ class _GuestAddAddressFormState extends State elevation: 0.0, height: AppSizes.buttonHeight, minWidth: MediaQuery.of(context).size.width, - color: Theme.of(context).colorScheme.onBackground, + color: Theme.of(context).colorScheme.onSurface, textColor: MobikulTheme.primaryColor, onPressed: () { _onPressSaveButton(); diff --git a/lib/screens/checkout/view/checkout_screen.dart b/lib/screens/checkout/view/checkout_screen.dart index 83b110d..7ce2209 100644 --- a/lib/screens/checkout/view/checkout_screen.dart +++ b/lib/screens/checkout/view/checkout_screen.dart @@ -423,7 +423,7 @@ class _CheckoutScreenState extends State { Expanded( flex: 1, child: MaterialButton( - color: Theme.of(context).colorScheme.onBackground, + color: Theme.of(context).colorScheme.onSurface, elevation: 0.0, textColor: MobikulTheme.primaryColor, shape: RoundedRectangleBorder( @@ -473,7 +473,7 @@ class _CheckoutScreenState extends State { ? StringConstants.placeOrder.localized() : StringConstants.proceed.localized().toUpperCase(), style: Theme.of(context).textTheme.labelMedium?.copyWith( - color: Theme.of(context).colorScheme.background + color: Theme.of(context).colorScheme.surface ), ), ), @@ -514,7 +514,7 @@ class _CheckoutScreenState extends State { Expanded( flex: 1, child: MaterialButton( - color: Theme.of(context).colorScheme.onBackground, + color: Theme.of(context).colorScheme.onSurface, elevation: 0.0, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(8.0), @@ -549,7 +549,7 @@ class _CheckoutScreenState extends State { ? StringConstants.placeOrder.localized() : StringConstants.proceed.localized().toUpperCase(), style: Theme.of(context).textTheme.labelMedium?.copyWith( - color: Theme.of(context).colorScheme.background + color: Theme.of(context).colorScheme.surface ), ), ), diff --git a/lib/screens/compare/view/compare_screen.dart b/lib/screens/compare/view/compare_screen.dart index d4c344b..08e6b0e 100644 --- a/lib/screens/compare/view/compare_screen.dart +++ b/lib/screens/compare/view/compare_screen.dart @@ -309,7 +309,7 @@ class _CompareScreenState extends State child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - Loader(), + const Loader(), const SizedBox( height: AppSizes.spacingNormal, ), diff --git a/lib/screens/compare/view/widget/compare_list.dart b/lib/screens/compare/view/widget/compare_list.dart index 14aa234..622e18e 100644 --- a/lib/screens/compare/view/widget/compare_list.dart +++ b/lib/screens/compare/view/widget/compare_list.dart @@ -90,7 +90,7 @@ class CompareList extends StatelessWidget { decoration: BoxDecoration( color: Theme.of(context) .colorScheme - .onBackground, + .onSurface, borderRadius: const BorderRadius.all( Radius.circular(20)), boxShadow: [ diff --git a/lib/screens/compare/view/widget/compare_view.dart b/lib/screens/compare/view/widget/compare_view.dart index ecdd0e5..b8d9065 100644 --- a/lib/screens/compare/view/widget/compare_view.dart +++ b/lib/screens/compare/view/widget/compare_view.dart @@ -166,7 +166,7 @@ class CompareView extends StatelessWidget { left: 8.0, top: 8, right: 8), child: ColorFiltered( colorFilter: ColorFilter.mode( - Theme.of(context).colorScheme.onBackground, + Theme.of(context).colorScheme.onSurface, BlendMode.srcIn, ), child: HtmlWidget( diff --git a/lib/screens/dashboard/view/dashboard.dart b/lib/screens/dashboard/view/dashboard.dart index 566f4ca..da2efd4 100644 --- a/lib/screens/dashboard/view/dashboard.dart +++ b/lib/screens/dashboard/view/dashboard.dart @@ -33,7 +33,7 @@ class _DashboardScreenState extends State Widget reviewsScreen = BlocProvider( create: (context) => ReviewsBloc(repository: ReviewsRepositoryImp(), context: context), - child: ReviewsScreen( + child: const ReviewsScreen( isFromDashboard: true, )); @@ -97,7 +97,7 @@ class _DashboardScreenState extends State ), Container( height: MediaQuery.of(context).size.height / 2.15, - color: Theme.of(context).colorScheme.background, + color: Theme.of(context).colorScheme.surface, child: TabBarView(children: [ ///orderScreen Column( @@ -115,9 +115,9 @@ class _DashboardScreenState extends State elevation: 0.0, height: AppSizes.buttonHeight, minWidth: MediaQuery.of(context).size.width, - color: Theme.of(context).colorScheme.onBackground, + color: Theme.of(context).colorScheme.onSurface, textColor: - Theme.of(context).colorScheme.background, + Theme.of(context).colorScheme.surface, onPressed: () { Navigator.pushReplacementNamed(context, home); }, @@ -136,7 +136,7 @@ class _DashboardScreenState extends State style: Theme.of(context) .textTheme .bodyLarge?.copyWith( - color: Theme.of(context).colorScheme.background + color: Theme.of(context).colorScheme.surface ), ), ], @@ -163,9 +163,9 @@ class _DashboardScreenState extends State elevation: 0.0, height: AppSizes.buttonHeight, minWidth: MediaQuery.of(context).size.width, - color: Theme.of(context).colorScheme.onBackground, + color: Theme.of(context).colorScheme.onSurface, textColor: - Theme.of(context).colorScheme.background, + Theme.of(context).colorScheme.surface, onPressed: () { addressIsEmpty ? Navigator.pushNamed(context, addAddressScreen, @@ -198,7 +198,7 @@ class _DashboardScreenState extends State .textTheme .bodyLarge ?.copyWith( - color: Theme.of(context).colorScheme.background), + color: Theme.of(context).colorScheme.surface), ), ], ), @@ -224,9 +224,9 @@ class _DashboardScreenState extends State elevation: 0.0, height: AppSizes.buttonHeight, minWidth: MediaQuery.of(context).size.width, - color: Theme.of(context).colorScheme.onBackground, + color: Theme.of(context).colorScheme.onSurface, textColor: - Theme.of(context).colorScheme.background, + Theme.of(context).colorScheme.surface, onPressed: () { Navigator.pushReplacementNamed(context, home); }, @@ -245,7 +245,7 @@ class _DashboardScreenState extends State style: Theme.of(context) .textTheme .bodyLarge?.copyWith( - color: Theme.of(context).colorScheme.background + color: Theme.of(context).colorScheme.surface ), ), ], diff --git a/lib/screens/downloadable_products/view/widgets/download_button.dart b/lib/screens/downloadable_products/view/widgets/download_button.dart index 94c9a23..bedd96b 100644 --- a/lib/screens/downloadable_products/view/widgets/download_button.dart +++ b/lib/screens/downloadable_products/view/widgets/download_button.dart @@ -22,14 +22,14 @@ class DownloadButton extends StatelessWidget { Widget build(BuildContext context) { return ElevatedButton( style: ButtonStyle( - maximumSize: MaterialStateProperty.all(const Size(270, 104)), - foregroundColor: MaterialStateProperty.all( - Theme.of(context).colorScheme.background, + maximumSize: WidgetStateProperty.all(const Size(270, 104)), + foregroundColor: WidgetStateProperty.all( + Theme.of(context).colorScheme.surface, ), - backgroundColor: MaterialStateProperty.all( - Theme.of(context).colorScheme.onBackground, + backgroundColor: WidgetStateProperty.all( + Theme.of(context).colorScheme.onSurface, ), - shape: MaterialStateProperty.all( + shape: WidgetStateProperty.all( RoundedRectangleBorder( borderRadius: BorderRadius.circular(8.0), ), @@ -57,7 +57,7 @@ class DownloadButton extends StatelessWidget { Icon( Icons.download, size: 17, - color: Theme.of(context).colorScheme.background, + color: Theme.of(context).colorScheme.surface, ), const SizedBox( width: 2, @@ -68,7 +68,7 @@ class DownloadButton extends StatelessWidget { "", style: TextStyle( fontSize: 14, - color: Theme.of(context).colorScheme.background, + color: Theme.of(context).colorScheme.surface, ), overflow: TextOverflow.clip, maxLines: 1, diff --git a/lib/screens/drawer/widget/log_out_button.dart b/lib/screens/drawer/widget/log_out_button.dart index 0e7f49e..de3d2da 100644 --- a/lib/screens/drawer/widget/log_out_button.dart +++ b/lib/screens/drawer/widget/log_out_button.dart @@ -28,9 +28,9 @@ class _LogoutButtonState extends State { _onPressedLogout(); }, title: MaterialButton( - color: Theme.of(context).colorScheme.onBackground, + color: Theme.of(context).colorScheme.onSurface, elevation: 0.0, - textColor: Theme.of(context).colorScheme.background, + textColor: Theme.of(context).colorScheme.surface, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8.0)), padding: const EdgeInsets.symmetric(vertical: 12.0), onPressed: () { @@ -45,7 +45,7 @@ class _LogoutButtonState extends State { child: Text( StringConstants.logOutTitle.localized().toUpperCase(), style: Theme.of(context).textTheme.labelMedium?.copyWith( - color: Theme.of(context).colorScheme.background + color: Theme.of(context).colorScheme.surface ), ), ), diff --git a/lib/screens/filter_screen/filter_screen.dart b/lib/screens/filter_screen/filter_screen.dart index 8bfe77a..3dbc228 100644 --- a/lib/screens/filter_screen/filter_screen.dart +++ b/lib/screens/filter_screen/filter_screen.dart @@ -66,11 +66,11 @@ class _SubCategoriesFilterScreenState extends State { } for (var options in data.options!) { for (var item in i["value"]) { - if ('\"${options.id}\"' == item) { - if (showTemp[code]?.contains('\"${options.id}\"') ?? false) { - showTemp[code]?.remove('\"${options.id}\"'); + if ('"${options.id}"' == item) { + if (showTemp[code]?.contains('"${options.id}"') ?? false) { + showTemp[code]?.remove('"${options.id}"'); } else { - showTemp[code]?.add('\"${options.id}\"'); + showTemp[code]?.add('"${options.id}"'); } } } @@ -111,8 +111,8 @@ class _SubCategoriesFilterScreenState extends State { setState(() { superAttributes = []; widget.filters.removeWhere((element) => - element["key"] != '\"category_id\"' || - element["key"] == '\"sort\"'); + element["key"] != '"category_id"' || + element["key"] == '"sort"'); widget.subCategoryBloc?.add(FetchSubCategoryEvent( widget.filters, @@ -203,7 +203,7 @@ class _SubCategoriesFilterScreenState extends State { child: RangeSlider( min: 0, max: 500, - activeColor: Theme.of(context).colorScheme.onBackground, + activeColor: Theme.of(context).colorScheme.onSurface, inactiveColor: Colors.grey.shade300, labels: RangeLabels( startPriceValue.toString(), @@ -213,11 +213,11 @@ class _SubCategoriesFilterScreenState extends State { onChanged: (RangeValues value) { setState(() { - widget.filters.removeWhere((element) => element["key"] == '\"$code\"'); + widget.filters.removeWhere((element) => element["key"] == '"$code"'); widget.filters.add({ - "key": '\"$code\"', - "value": '\"${value.start}, ${value.end}\"' + "key": '"$code"', + "value": '"${value.start}, ${value.end}"' }); temp[code]?.clear(); @@ -230,7 +230,7 @@ class _SubCategoriesFilterScreenState extends State { temp.forEach((key, value) { if (value.isNotEmpty) { Map colorMap = { - "key": '\"$key\"', + "key": '"$key"', "value": value }; superAttributes.add(colorMap); @@ -251,24 +251,24 @@ class _SubCategoriesFilterScreenState extends State { return CheckboxListTile( dense: true, contentPadding: const EdgeInsets.all(0), - value: showItems.contains(('\"${option?.id}\"')), + value: showItems.contains(('"${option?.id}"')), title: Text( option?.adminName ?? "", style: Theme.of(context).textTheme.bodyMedium, ), onChanged: (isChecked) { widget.filters.removeWhere( - (element) => element["key"] == '\"$code\"'); + (element) => element["key"] == '"$code"'); widget.filters.add( - {"key": '\"$code\"', "value": '\"${option?.id}\"'}); + {"key": '"$code"', "value": '"${option?.id}"'}); setState(() { temp.addAll(showTemp); - if (temp[code]?.contains('\"${option?.id}\"') ?? false) { - temp[code]?.remove('\"${option?.id}\"'); + if (temp[code]?.contains('"${option?.id}"') ?? false) { + temp[code]?.remove('"${option?.id}"'); } else { - temp[code]?.add('\"${option?.id}\"'); + temp[code]?.add('"${option?.id}"'); } showItems.clear(); @@ -279,7 +279,7 @@ class _SubCategoriesFilterScreenState extends State { temp.forEach((key, value) { if (value.isNotEmpty) { Map colorMap = { - "key": '\"$key\"', + "key": '"$key"', "value": value }; superAttributes.add(colorMap); diff --git a/lib/screens/filter_screen/sort_screen.dart b/lib/screens/filter_screen/sort_screen.dart index e4d725a..4d5cd5a 100644 --- a/lib/screens/filter_screen/sort_screen.dart +++ b/lib/screens/filter_screen/sort_screen.dart @@ -93,7 +93,7 @@ class _SortBottomSheetState extends State { ), TextButton( onPressed: () async { - widget.filters.removeWhere((element) => element["key"] == '\"sort\"'); + widget.filters.removeWhere((element) => element["key"] == '"sort"'); widget.subCategoryBloc?.add(FetchSubCategoryEvent( widget.filters, widget.page)); widget.subCategoryBloc?.add( @@ -133,11 +133,11 @@ class _SortBottomSheetState extends State { SharedPreferenceHelper.setSortName(value ?? ""); }); - widget.filters.removeWhere((element) => element["key"] == '\"sort\"'); + widget.filters.removeWhere((element) => element["key"] == '"sort"'); widget.filters.add({ - "key": '\"sort\"', - "value": '\"${data?[index].value}\"' + "key": '"sort"', + "value": '"${data?[index].value}"' }); widget.subCategoryBloc?.add(FetchSubCategoryEvent( diff --git a/lib/screens/forget_password/forget_password.dart b/lib/screens/forget_password/forget_password.dart index f125d97..b1f61f5 100644 --- a/lib/screens/forget_password/forget_password.dart +++ b/lib/screens/forget_password/forget_password.dart @@ -145,7 +145,7 @@ class _ForgetPasswordScreenState extends State elevation: 0.0, height: AppSizes.buttonHeight, minWidth: MediaQuery.of(context).size.width, - color: Theme.of(context).colorScheme.onBackground, + color: Theme.of(context).colorScheme.onSurface, textColor: Colors.white, onPressed: () { _onPressButton(); @@ -153,7 +153,7 @@ class _ForgetPasswordScreenState extends State child: Text( StringConstants.forgetPasswordButton.localized().toUpperCase(), style: Theme.of(context).textTheme.labelMedium?.copyWith( - color: Theme.of(context).colorScheme.background + color: Theme.of(context).colorScheme.surface ), ), ), diff --git a/lib/screens/home_page/bloc/home_page_bloc.dart b/lib/screens/home_page/bloc/home_page_bloc.dart index 4e79173..dcecba7 100644 --- a/lib/screens/home_page/bloc/home_page_bloc.dart +++ b/lib/screens/home_page/bloc/home_page_bloc.dart @@ -17,7 +17,6 @@ import '../../../data_model/graphql_base_model.dart'; import '../../../utils/app_global_data.dart'; import '../../../utils/string_constants.dart'; import '../../cart_screen/cart_model/add_to_cart_model.dart'; -import '../../cms_screen/data_model/cms_model.dart'; import '../data_model/advertisement_data.dart'; import '../data_model/get_categories_drawer_data_model.dart'; import '../data_model/new_product_data.dart'; diff --git a/lib/screens/home_page/bloc/home_page_repository.dart b/lib/screens/home_page/bloc/home_page_repository.dart index 71b3ad3..76fafb7 100644 --- a/lib/screens/home_page/bloc/home_page_repository.dart +++ b/lib/screens/home_page/bloc/home_page_repository.dart @@ -4,7 +4,6 @@ import '../../../data_model/add_to_wishlist_model/add_wishlist_model.dart'; import '../../../data_model/graphql_base_model.dart'; import '../../../services/api_client.dart'; import '../../cart_screen/cart_model/add_to_cart_model.dart'; -import '../../cms_screen/data_model/cms_model.dart'; import '../data_model/advertisement_data.dart'; import '../data_model/get_categories_drawer_data_model.dart'; import '../data_model/new_product_data.dart'; diff --git a/lib/screens/home_page/bloc/home_page_state.dart b/lib/screens/home_page/bloc/home_page_state.dart index 1ebae86..8bceaba 100644 --- a/lib/screens/home_page/bloc/home_page_state.dart +++ b/lib/screens/home_page/bloc/home_page_state.dart @@ -2,7 +2,6 @@ import '../../../data_model/account_models/account_info_details.dart'; import '../../../data_model/add_to_wishlist_model/add_wishlist_model.dart'; import '../../../data_model/graphql_base_model.dart'; import '../../cart_screen/cart_model/add_to_cart_model.dart'; -import '../../cms_screen/data_model/cms_model.dart'; import '../data_model/advertisement_data.dart'; import '../data_model/get_categories_drawer_data_model.dart'; import '../data_model/new_product_data.dart'; diff --git a/lib/screens/home_page/home_page.dart b/lib/screens/home_page/home_page.dart index 414f12b..c7f3161 100644 --- a/lib/screens/home_page/home_page.dart +++ b/lib/screens/home_page/home_page.dart @@ -401,8 +401,8 @@ class _HomeScreenState extends State { if(element.type == "category_carousel"){ element.translations?.firstOrNull?.options?.filters?.forEach((element) { filters.add({ - "key": '\"${element.key}\"', - "value": '\"${element.value}\"' + "key": '"${element.key}"', + "value": '"${element.value}"' }); }); homePageBloc?.add(FetchHomePageCategoriesEvent(filters: filters)); @@ -411,8 +411,8 @@ class _HomeScreenState extends State { filters.clear(); element.translations?.firstOrNull?.options?.filters?.forEach((element) { filters.add({ - "key": '\"${element.key}\"', - "value": '\"${element.value}\"' + "key": '"${element.key}"', + "value": '"${element.value}"' }); }); homePageBloc?.add(FetchAllProductsEvent(filters)); diff --git a/lib/screens/home_page/widget/home_page_view.dart b/lib/screens/home_page/widget/home_page_view.dart index 19bf165..d51dd95 100644 --- a/lib/screens/home_page/widget/home_page_view.dart +++ b/lib/screens/home_page/widget/home_page_view.dart @@ -21,7 +21,6 @@ import '../../recent_product/recent_product_view.dart'; import '../bloc/home_page_bloc.dart'; import '../bloc/home_page_event.dart'; import '../data_model/get_categories_drawer_data_model.dart'; -import '../data_model/new_product_data.dart'; import '../data_model/theme_customization.dart'; import 'carousal_slider.dart'; import 'new_product_view.dart'; @@ -246,8 +245,7 @@ class _HomePagViewState extends State { } String getHtmlView(String html, String css) { - css = css + - """div { + css = """${css}div { flex-direction: column; column-count: 1 !important; width: 100%; diff --git a/lib/screens/home_page/widget/new_product_view.dart b/lib/screens/home_page/widget/new_product_view.dart index a16a46d..fae6bf0 100644 --- a/lib/screens/home_page/widget/new_product_view.dart +++ b/lib/screens/home_page/widget/new_product_view.dart @@ -1,4 +1,3 @@ -import 'package:bagisto_app_demo/screens/account/view/account_screen.dart'; import 'package:bagisto_app_demo/utils/application_localization.dart'; import 'package:bagisto_app_demo/widgets/price_widget.dart'; import 'package:bagisto_app_demo/widgets/wishlist_compare_widget.dart'; diff --git a/lib/screens/home_page/widget/view_all_button.dart b/lib/screens/home_page/widget/view_all_button.dart index 033d649..8ce4f63 100644 --- a/lib/screens/home_page/widget/view_all_button.dart +++ b/lib/screens/home_page/widget/view_all_button.dart @@ -20,20 +20,20 @@ Widget viewAllButton(BuildContext context, } }, style: ButtonStyle( - backgroundColor: MaterialStateProperty.all( + backgroundColor: WidgetStateProperty.all( backGroundColor ), - foregroundColor: MaterialStateProperty.all( + foregroundColor: WidgetStateProperty.all( foregroundColor ), - padding: MaterialStateProperty.all( + padding: WidgetStateProperty.all( const EdgeInsets.symmetric( vertical: AppSizes.spacingLarge, horizontal: AppSizes.spacingLarge*2)), - side: MaterialStateProperty.all(BorderSide( + side: WidgetStateProperty.all(BorderSide( color: MobikulTheme.accentColor, )), - shape: MaterialStateProperty.all( + shape: WidgetStateProperty.all( RoundedRectangleBorder( borderRadius: BorderRadius.circular(AppSizes.spacingLarge), ))), diff --git a/lib/screens/location/view/location_screen.dart b/lib/screens/location/view/location_screen.dart index f3f4553..a49ec20 100644 --- a/lib/screens/location/view/location_screen.dart +++ b/lib/screens/location/view/location_screen.dart @@ -74,7 +74,7 @@ class _LocationScreenState extends State { }); }, ), - Positioned( + const Positioned( right: 0, top: 0, left: 0, @@ -131,7 +131,7 @@ class _LocationScreenState extends State { ), ), ]) - : Loader(), + : const Loader(), ), GestureDetector( onTap: () { @@ -185,7 +185,7 @@ class _LocationScreenState extends State { } void getCurrentLocation() async { - var location; + location.LocationData location; try { location = await currentLocation.getLocation(); } catch (e) { diff --git a/lib/screens/order_detail/bloc/order_detail_event.dart b/lib/screens/order_detail/bloc/order_detail_event.dart index cd4808b..f103f97 100644 --- a/lib/screens/order_detail/bloc/order_detail_event.dart +++ b/lib/screens/order_detail/bloc/order_detail_event.dart @@ -27,6 +27,7 @@ class CancelOrderEvent extends OrderDetailBaseEvent { CancelOrderEvent(this.id, this.message); + @override List get props => [message ?? ""]; } diff --git a/lib/screens/product_screen/bloc/product_page_bloc.dart b/lib/screens/product_screen/bloc/product_page_bloc.dart index e8f5cbf..0044c8b 100644 --- a/lib/screens/product_screen/bloc/product_page_bloc.dart +++ b/lib/screens/product_screen/bloc/product_page_bloc.dart @@ -25,7 +25,7 @@ class ProductScreenBLoc extends Bloc { if (event is FetchProductEvent) { try { NewProductsModel? productData = await repository?.getProductDetails([ - {"key": '\"url_key\"', "value": '\"${event.sku}\"'} + {"key": '"url_key"', "value": '"${event.sku}"'} ]); emit(FetchProductState.success(productData: productData?.data?.firstOrNull)); } catch (e) { diff --git a/lib/screens/product_screen/view/bundle_option_view.dart b/lib/screens/product_screen/view/bundle_option_view.dart index b0181b9..2754701 100644 --- a/lib/screens/product_screen/view/bundle_option_view.dart +++ b/lib/screens/product_screen/view/bundle_option_view.dart @@ -164,8 +164,8 @@ class _BundleOptionsViewState extends State { height: 8, ), CheckboxGroup( - activeColor: Theme.of(context).colorScheme.onBackground, - checkColor: Theme.of(context).colorScheme.background, + activeColor: Theme.of(context).colorScheme.onSurface, + checkColor: Theme.of(context).colorScheme.surface, labels: val?.toList(), onChange: (isChecked, label, index, key) { diff --git a/lib/screens/product_screen/view/product_review_summary_view.dart b/lib/screens/product_screen/view/product_review_summary_view.dart index 86492c5..a2ececa 100644 --- a/lib/screens/product_screen/view/product_review_summary_view.dart +++ b/lib/screens/product_screen/view/product_review_summary_view.dart @@ -132,12 +132,12 @@ class ProductReviewSummaryViewState extends State { 8, ((widget.review?.length ?? 0) > 0 ? 8 : 0), 0, 0), child: TextButton( style: ButtonStyle( - padding: MaterialStateProperty.all( + padding: WidgetStateProperty.all( const EdgeInsets.symmetric( vertical: 8, horizontal: 15)), - foregroundColor: MaterialStateProperty.all( + foregroundColor: WidgetStateProperty.all( Theme.of(context).colorScheme.onPrimary), - shape: MaterialStateProperty.all( + shape: WidgetStateProperty.all( RoundedRectangleBorder( borderRadius: BorderRadius.circular(8.0), side: BorderSide( diff --git a/lib/screens/product_screen/view/product_screen.dart b/lib/screens/product_screen/view/product_screen.dart index 714fcb9..7d53cfb 100644 --- a/lib/screens/product_screen/view/product_screen.dart +++ b/lib/screens/product_screen/view/product_screen.dart @@ -123,13 +123,13 @@ class _ProductScreenState extends State { child: MaterialButton( shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(AppSizes.spacingMedium), - side: BorderSide(color: Theme.of(context).colorScheme.onBackground) + side: BorderSide(color: Theme.of(context).colorScheme.onSurface) ), elevation: AppSizes.spacingSmall, height: AppSizes.buttonHeight, minWidth: MediaQuery.of(context).size.width, - color: Theme.of(context).colorScheme.background, - textColor: Theme.of(context).colorScheme.onBackground, + color: Theme.of(context).colorScheme.surface, + textColor: Theme.of(context).colorScheme.onSurface, onPressed: () { checkInternetConnection().then((value) { if (value) { diff --git a/lib/screens/product_screen/view/widget/add_to_cart_view.dart b/lib/screens/product_screen/view/widget/add_to_cart_view.dart index eb2b6f2..8ff12cd 100644 --- a/lib/screens/product_screen/view/widget/add_to_cart_view.dart +++ b/lib/screens/product_screen/view/widget/add_to_cart_view.dart @@ -32,8 +32,8 @@ import 'package:flutter_bloc/flutter_bloc.dart'; elevation: AppSizes.spacingSmall, height: AppSizes.buttonHeight, minWidth: MediaQuery.of(context).size.width, - color: Theme.of(context).colorScheme.background, - textColor: Theme.of(context).colorScheme.onBackground, + color: Theme.of(context).colorScheme.surface, + textColor: Theme.of(context).colorScheme.onSurface, onPressed: () { ProductScreenBLoc productBloc = context.read(); diff --git a/lib/screens/product_screen/view/widget/review_linear_progress_indicator.dart b/lib/screens/product_screen/view/widget/review_linear_progress_indicator.dart index 1901a82..0f5615a 100644 --- a/lib/screens/product_screen/view/widget/review_linear_progress_indicator.dart +++ b/lib/screens/product_screen/view/widget/review_linear_progress_indicator.dart @@ -42,7 +42,7 @@ class ReviewLinearProgressIndicator extends StatelessWidget { ), Text( '(${percentage[0].toString()}%)', - style: TextStyle( + style: const TextStyle( fontSize: 12, color: Colors.black, fontWeight: FontWeight.w500), @@ -53,7 +53,7 @@ class ReviewLinearProgressIndicator extends StatelessWidget { children: [ Text( '4Star'.localized(), - style: TextStyle( + style: const TextStyle( fontSize: 12, color: Colors.black, fontWeight: FontWeight.w500), @@ -73,7 +73,7 @@ class ReviewLinearProgressIndicator extends StatelessWidget { ), Text( '(${percentage[1] ?? 0}%)', - style: TextStyle( + style: const TextStyle( fontSize: 12, color: Colors.black, fontWeight: FontWeight.w500), @@ -84,7 +84,7 @@ class ReviewLinearProgressIndicator extends StatelessWidget { children: [ Text( '3Star'.localized(), - style: TextStyle( + style: const TextStyle( fontSize: 12, color: Colors.black, fontWeight: FontWeight.w500), diff --git a/lib/screens/review/bloc/review_event.dart b/lib/screens/review/bloc/review_event.dart index 11780e2..7ac97ec 100644 --- a/lib/screens/review/bloc/review_event.dart +++ b/lib/screens/review/bloc/review_event.dart @@ -31,6 +31,7 @@ class RemoveReviewEvent extends ReviewsBaseEvent { RemoveReviewEvent(this.productId, this.message); + @override List get props => [productId ?? "", message ?? ""]; } @@ -38,6 +39,7 @@ class RemoveAllReviewsEvent extends ReviewsBaseEvent { RemoveAllReviewsEvent(); + @override List get props => []; } \ No newline at end of file diff --git a/lib/screens/review/screen/reviews.dart b/lib/screens/review/screen/reviews.dart index 8b0f9b1..d7618a3 100644 --- a/lib/screens/review/screen/reviews.dart +++ b/lib/screens/review/screen/reviews.dart @@ -10,11 +10,10 @@ import 'dart:async'; import 'package:bagisto_app_demo/screens/cart_screen/cart_index.dart'; -import 'package:bagisto_app_demo/utils/no_data_found_widget.dart'; import 'package:bagisto_app_demo/screens/review/utils/index.dart'; class ReviewsScreen extends StatefulWidget { - ReviewsScreen({Key? key, this.isFromDashboard}) : super(key: key); + const ReviewsScreen({Key? key, this.isFromDashboard}) : super(key: key); final bool? isFromDashboard; @override @@ -29,7 +28,7 @@ class _ReviewsScreenState extends State { ReviewsBloc? reviewsBloc; Stream get onUpdate => streamController.stream; - bool _isVisible = false; + final bool _isVisible = false; @override void initState() { @@ -97,24 +96,24 @@ class _ReviewsScreenState extends State { } else if (state is RemoveReviewState) { if (state.status == ReviewStatus.fail) { ShowMessage.showNotification( - "Failed", state.error, Colors.red, Icon(Icons.cancel_outlined)); + "Failed", state.error, Colors.red, const Icon(Icons.cancel_outlined)); } else if (state.status == ReviewStatus.success) { ShowMessage.showNotification( "Success", state.baseModel?.message, - Color.fromRGBO(140, 194, 74, 5), - Icon(Icons.check_circle_outline)); + const Color.fromRGBO(140, 194, 74, 5), + const Icon(Icons.check_circle_outline)); } } else if (state is RemoveAllReviewState) { if (state.status == ReviewStatus.fail) { ShowMessage.showNotification( - "Failed", state.error, Colors.red, Icon(Icons.cancel_outlined)); + "Failed", state.error, Colors.red, const Icon(Icons.cancel_outlined)); } else if (state.status == ReviewStatus.success) { ShowMessage.showNotification( "Success", state.baseModel?.message, - Color.fromRGBO(140, 194, 74, 5), - Icon(Icons.check_circle_outline)); + const Color.fromRGBO(140, 194, 74, 5), + const Icon(Icons.check_circle_outline)); } } }, @@ -165,34 +164,30 @@ class _ReviewsScreenState extends State { ///method use to show review list _reviewsList(ReviewModel reviewModel) { - if (reviewModel == null) { - return const NoDataFound(); + if ((reviewModel.data ?? []).isEmpty) { + streamController.add(false); + return const EmptyDataView( + assetPath: AssetConstants.emptyReviews, + message: "noReview", + ); } else { - if ((reviewModel.data ?? []).isEmpty) { - streamController.add(false); - return const EmptyDataView( - assetPath: AssetConstants.emptyReviews, - message: "noReview", - ); - } else { - streamController.add(true); - return Padding( - padding: const EdgeInsets.fromLTRB(8.0,8,8,0), - child: ListView.builder( - itemCount: (widget.isFromDashboard ?? false) - ? ((reviewModel.data?.length ?? 0) > 5) - ? 5 - : reviewModel.data?.length ?? 0 - : reviewModel.data?.length ?? 0, - itemBuilder: (context, index) { - return ReviewsList( - reviewData: reviewModel.data?[index], - reviewsBloc: - reviewsBloc, /*callback: _callBack(int.parse(reviewModel.data?[index].id??"")),*/ - ); - }), - ); - } + streamController.add(true); + return Padding( + padding: const EdgeInsets.fromLTRB(8.0,8,8,0), + child: ListView.builder( + itemCount: (widget.isFromDashboard ?? false) + ? ((reviewModel.data?.length ?? 0) > 5) + ? 5 + : reviewModel.data?.length ?? 0 + : reviewModel.data?.length ?? 0, + itemBuilder: (context, index) { + return ReviewsList( + reviewData: reviewModel.data?[index], + reviewsBloc: + reviewsBloc, /*callback: _callBack(int.parse(reviewModel.data?[index].id??"")),*/ + ); + }), + ); + } } - } } diff --git a/lib/screens/search_screen/view/search_screen.dart b/lib/screens/search_screen/view/search_screen.dart index 05374ba..8523af9 100644 --- a/lib/screens/search_screen/view/search_screen.dart +++ b/lib/screens/search_screen/view/search_screen.dart @@ -84,7 +84,7 @@ class _SearchScreenState extends State searchBloc?.add(CircularBarEvent(isReqToShowLoader: true)); searchBloc?.add(SearchBarTextEvent(searchText: transcription)); searchBloc?.add(FetchSearchEvent([ - {"key": '\"name\"', "value": '\"$transcription\"'} + {"key": '"name"', "value": '"$transcription"'} ])); } stop(); @@ -189,7 +189,7 @@ class _SearchScreenState extends State searchBloc?.add(SearchBarTextEvent(searchText: value)); searchBloc?.add(CircularBarEvent(isReqToShowLoader: true)); searchBloc?.add(FetchSearchEvent([ - {"key": '\"name\"', "value": '\"$value\"'} + {"key": '"name"', "value": '"$value"'} ])); } }, @@ -325,7 +325,7 @@ class _SearchScreenState extends State searchBloc?.add(CircularBarEvent(isReqToShowLoader: true)); searchBloc?.add(SearchBarTextEvent(searchText: data)); searchBloc?.add(FetchSearchEvent([ - {"key": '\"name\"', "value": '\"$data\"'} + {"key": '"name"', "value": '"$data"'} ])); return data; } else { diff --git a/lib/screens/sign_in/sign_in_screen.dart b/lib/screens/sign_in/sign_in_screen.dart index ba21c26..8f75b0e 100644 --- a/lib/screens/sign_in/sign_in_screen.dart +++ b/lib/screens/sign_in/sign_in_screen.dart @@ -246,7 +246,7 @@ class _SignInScreenState extends State with EmailValidator { height: AppSizes.buttonHeight, minWidth: MediaQuery.of(context).size.width, color: MobikulTheme.accentColor, - textColor: Theme.of(context).colorScheme.onBackground, + textColor: Theme.of(context).colorScheme.onSurface, onPressed: () { _onPressSignInButton(); }, @@ -266,7 +266,7 @@ class _SignInScreenState extends State with EmailValidator { height: AppSizes.buttonHeight, minWidth: MediaQuery.of(context).size.width, color: MobikulTheme.primaryColor, - textColor: Theme.of(context).colorScheme.background, + textColor: Theme.of(context).colorScheme.surface, onPressed: () { Navigator.pushNamed(context, signUp, arguments: false); }, diff --git a/lib/screens/sign_up/sign_up.dart b/lib/screens/sign_up/sign_up.dart index 17b94d9..2f42f12 100644 --- a/lib/screens/sign_up/sign_up.dart +++ b/lib/screens/sign_up/sign_up.dart @@ -257,15 +257,15 @@ class _SignUpScreenState extends State with EmailValidator { elevation: 0.0, height: 48, minWidth: MediaQuery.of(context).size.width, - color: Theme.of(context).colorScheme.onBackground, - textColor: Theme.of(context).colorScheme.background, + color: Theme.of(context).colorScheme.onSurface, + textColor: Theme.of(context).colorScheme.surface, onPressed: () { _onPressCreateAccount(); }, child: Text( StringConstants.createAccountLabel.localized().toUpperCase(), style: Theme.of(context).textTheme.labelSmall?.copyWith( - color: Theme.of(context).colorScheme.background + color: Theme.of(context).colorScheme.surface ), ), ), diff --git a/lib/screens/splash_screen/splash_screen.dart b/lib/screens/splash_screen/splash_screen.dart index e68017d..7ad3692 100644 --- a/lib/screens/splash_screen/splash_screen.dart +++ b/lib/screens/splash_screen/splash_screen.dart @@ -15,7 +15,6 @@ import 'package:lottie/lottie.dart'; import 'package:path_provider/path_provider.dart'; import '../../services/graph_ql.dart'; import '../../utils/assets_constants.dart'; -import '../../utils/prefetching_helper.dart'; import '../../utils/route_constants.dart'; import '../../utils/server_configuration.dart'; diff --git a/lib/screens/wishList/data_model/wishlist_model.dart b/lib/screens/wishList/data_model/wishlist_model.dart index 6e0d2b8..393bb4e 100644 --- a/lib/screens/wishList/data_model/wishlist_model.dart +++ b/lib/screens/wishList/data_model/wishlist_model.dart @@ -125,5 +125,6 @@ class ShareWishlistData extends GraphQlBaseModel { factory ShareWishlistData.fromJson(Map json) => _$ShareWishlistDataFromJson(json); + @override Map toJson() => _$ShareWishlistDataToJson(this); } diff --git a/lib/screens/wishList/view/wishlist_screen.dart b/lib/screens/wishList/view/wishlist_screen.dart index 490ea91..21b6363 100644 --- a/lib/screens/wishList/view/wishlist_screen.dart +++ b/lib/screens/wishList/view/wishlist_screen.dart @@ -112,7 +112,7 @@ class _WishListScreenState extends State { }, child: Icon( Icons.delete, - color: Theme.of(context).colorScheme.onBackground, + color: Theme.of(context).colorScheme.onSurface, ), ), ); @@ -127,7 +127,7 @@ class _WishListScreenState extends State { }, child: Icon( Icons.delete, - color: Theme.of(context).colorScheme.onBackground, + color: Theme.of(context).colorScheme.onSurface, ), ), ); diff --git a/lib/utils/app_navigation.dart b/lib/utils/app_navigation.dart index a318e30..b61390c 100644 --- a/lib/utils/app_navigation.dart +++ b/lib/utils/app_navigation.dart @@ -211,7 +211,7 @@ Route generateRoute(RouteSettings settings) { builder: (_) => BlocProvider( create: (context) => ReviewsBloc( repository: ReviewsRepositoryImp(), context: context), - child: ReviewsScreen())); + child: const ReviewsScreen())); case addressListScreen : diff --git a/lib/utils/check_box_group.dart b/lib/utils/check_box_group.dart index ae08dfd..1eb794e 100644 --- a/lib/utils/check_box_group.dart +++ b/lib/utils/check_box_group.dart @@ -72,8 +72,8 @@ class _CheckboxGroupState extends State { Checkbox cb = Checkbox( value: _selected.contains(widget.labels?.elementAt(i)), onChanged: (bool? isChecked) => onChanged(isChecked ?? false, i), - checkColor: Theme.of(context).colorScheme.background, - activeColor: Theme.of(context).colorScheme.onBackground, + checkColor: Theme.of(context).colorScheme.surface, + activeColor: Theme.of(context).colorScheme.onSurface, tristate: widget.triState, ); diff --git a/lib/utils/mobikul_theme.dart b/lib/utils/mobikul_theme.dart index 5c26d52..5c07486 100644 --- a/lib/utils/mobikul_theme.dart +++ b/lib/utils/mobikul_theme.dart @@ -36,9 +36,9 @@ class MobikulTheme { ) ), checkboxTheme: CheckboxThemeData( - checkColor: MaterialStateProperty.all( + checkColor: WidgetStateProperty.all( primaryColor), - fillColor: MaterialStateProperty.all( + fillColor: WidgetStateProperty.all( accentColor) ), drawerTheme: const DrawerThemeData( @@ -47,8 +47,8 @@ class MobikulTheme { colorScheme: ColorScheme.light( primary: primaryColor, onPrimary: accentColor, - background: primaryColor, - onBackground: accentColor + surface: primaryColor, + onSurface: accentColor ), dividerTheme: DividerThemeData(color: Colors.grey.shade300), sliderTheme: const SliderThemeData( @@ -163,13 +163,13 @@ class MobikulTheme { colorScheme: ColorScheme.dark( primary: accentColor, onPrimary: primaryColor, - background: accentColor, - onBackground: primaryColor + surface: accentColor, + onSurface: primaryColor ), checkboxTheme: CheckboxThemeData( - checkColor: MaterialStateProperty.all( + checkColor: WidgetStateProperty.all( accentColor), - fillColor: MaterialStateProperty.all( + fillColor: WidgetStateProperty.all( primaryColor) ), textTheme: TextTheme( diff --git a/lib/utils/radio_button_group.dart b/lib/utils/radio_button_group.dart index 63927a3..ee334cf 100644 --- a/lib/utils/radio_button_group.dart +++ b/lib/utils/radio_button_group.dart @@ -105,10 +105,12 @@ class _RadioButtonGroupState extends State { : (var index) => setState(() { _selected = widget.labels?.elementAt(i) ?? ''; - if (widget.onChange != null) + if (widget.onChange != null) { widget.onChange!(widget.labels?.elementAt(i) ?? '', i); - if (widget.onSelected != null) + } + if (widget.onSelected != null) { widget.onSelected!(widget.labels?.elementAt(i) ?? ''); + } }), ); diff --git a/lib/widgets/common_date_picker.dart b/lib/widgets/common_date_picker.dart index 08a0738..6eb90bd 100644 --- a/lib/widgets/common_date_picker.dart +++ b/lib/widgets/common_date_picker.dart @@ -65,7 +65,7 @@ class _CommonDatePickerState extends State { data: ThemeData( primarySwatch: Colors.grey, colorScheme: ColorScheme.light( - primary: Theme.of(context).colorScheme.onBackground, + primary: Theme.of(context).colorScheme.onSurface, onPrimary: Colors.white, onSurface: Colors.black, secondary: Colors.black), diff --git a/lib/widgets/common_drop_down_field.dart b/lib/widgets/common_drop_down_field.dart index df58f94..e423c6e 100644 --- a/lib/widgets/common_drop_down_field.dart +++ b/lib/widgets/common_drop_down_field.dart @@ -40,7 +40,7 @@ class CommonDropDownField extends StatelessWidget { ? Container() : Theme( data: Theme.of(context).copyWith( - canvasColor: Theme.of(context).colorScheme.background, + canvasColor: Theme.of(context).colorScheme.surface, ), child: DropdownButtonFormField( iconEnabledColor: Theme.of(context).colorScheme.onPrimary, diff --git a/lib/widgets/common_widgets.dart b/lib/widgets/common_widgets.dart index 05c6e68..2746dd2 100644 --- a/lib/widgets/common_widgets.dart +++ b/lib/widgets/common_widgets.dart @@ -118,14 +118,14 @@ class CommonWidgets with EmailValidator { {bool showIcon = false}) => ElevatedButton( style: ButtonStyle( - maximumSize: MaterialStateProperty.all(Size(buttonWidth, 60)), - foregroundColor: MaterialStateProperty.all( - Theme.of(context).colorScheme.onBackground, + maximumSize: WidgetStateProperty.all(Size(buttonWidth, 60)), + foregroundColor: WidgetStateProperty.all( + Theme.of(context).colorScheme.onSurface, ), - backgroundColor: MaterialStateProperty.all( + backgroundColor: WidgetStateProperty.all( Theme.of(context).colorScheme.primary, ), - shape: MaterialStateProperty.all( + shape: WidgetStateProperty.all( RoundedRectangleBorder( borderRadius: BorderRadius.circular(AppSizes.spacingMedium), ), @@ -140,13 +140,13 @@ class CommonWidgets with EmailValidator { Icon( Icons.shopping_cart, size: 17, - color: Theme.of(context).colorScheme.onBackground, + color: Theme.of(context).colorScheme.onSurface, ), Text( title.toUpperCase(), style: TextStyle( fontSize: 10, - color: Theme.of(context).colorScheme.onBackground), + color: Theme.of(context).colorScheme.onSurface), overflow: TextOverflow.clip, maxLines: 1, ), @@ -188,7 +188,7 @@ class CommonWidgets with EmailValidator { const SizedBox(height: 6), Theme( data: Theme.of(context).copyWith( - canvasColor: Theme.of(context).colorScheme.background, + canvasColor: Theme.of(context).colorScheme.surface, ), child: DropdownButtonFormField( style: Theme.of(context).textTheme.bodyMedium, @@ -223,7 +223,7 @@ class CommonWidgets with EmailValidator { fillColor: Colors.black, focusedBorder: OutlineInputBorder( borderSide: BorderSide( - color: Theme.of(context).colorScheme.onBackground, + color: Theme.of(context).colorScheme.onSurface, width: 1, ), borderRadius: const BorderRadius.all( diff --git a/lib/widgets/empty_data_view.dart b/lib/widgets/empty_data_view.dart index 7a3088f..11185de 100644 --- a/lib/widgets/empty_data_view.dart +++ b/lib/widgets/empty_data_view.dart @@ -34,7 +34,7 @@ class EmptyDataView extends StatelessWidget { children: [ ColorFiltered( colorFilter: ColorFilter.mode( - Theme.of(context).colorScheme.onBackground, + Theme.of(context).colorScheme.onSurface, BlendMode.srcIn, ), child: LottieBuilder.asset(assetPath, diff --git a/lib/widgets/loader.dart b/lib/widgets/loader.dart index 0e174cb..f746608 100644 --- a/lib/widgets/loader.dart +++ b/lib/widgets/loader.dart @@ -32,7 +32,7 @@ class Loader extends StatelessWidget { if ((loadingMessage ?? "").isNotEmpty) const SizedBox(height: 24), CircularProgressIndicator( valueColor: AlwaysStoppedAnimation( - Theme.of(context).colorScheme.onBackground, + Theme.of(context).colorScheme.onSurface, ), ), ], diff --git a/lib/widgets/wishlist_compare_widget.dart b/lib/widgets/wishlist_compare_widget.dart index 8957393..0e7160a 100644 --- a/lib/widgets/wishlist_compare_widget.dart +++ b/lib/widgets/wishlist_compare_widget.dart @@ -25,7 +25,7 @@ Widget wishlistIcon(BuildContext context, bool? isInWishlist){ Icons.favorite, color: Theme.of(context) .colorScheme - .onBackground, + .onSurface, size: 16, ) : Icon( @@ -33,7 +33,7 @@ Widget wishlistIcon(BuildContext context, bool? isInWishlist){ size: 16, color: Theme.of(context) .colorScheme - .onBackground, + .onSurface, ), ); } @@ -61,7 +61,7 @@ Widget compareIcon(BuildContext context){ "assets/images/compare-icon.png", height: 18, width: 18, - color: Theme.of(context).colorScheme.onBackground, + color: Theme.of(context).colorScheme.onSurface, ), ); } \ No newline at end of file diff --git a/pubspec.yaml b/pubspec.yaml index 0762677..9008add 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -77,6 +77,10 @@ dependencies: + dio: any + retrofit: any + collection: any + sqflite: any dependency_overrides: intl: ^0.18.0