Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Change UI of new product type cards #5857

Merged
merged 11 commits into from
Nov 23, 2024
14 changes: 14 additions & 0 deletions packages/smooth_app/assets/misc/logo_obf_half.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions packages/smooth_app/assets/misc/logo_off_half.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions packages/smooth_app/assets/misc/logo_opf_half.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions packages/smooth_app/assets/misc/logo_opff_half.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions packages/smooth_app/lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -3271,5 +3271,21 @@
"carousel_loading_text": "We are searching for it in our database of more than **3 million products!**",
"@carousel_loading_text": {
"description": "Please keep the ** syntax to make the text bold"
},
"product_type_subtitle_food": "Vegetables, fruits, frozen food…",
"@product_type_subtitle_food" : {
"description": "Example of products for food category"
},
"product_type_subtitle_beauty": "Makeup, soaps, toothpastes…",
"@product_type_subtitle_beauty" : {
"description": "Example of products for beauty category"
},
"product_type_subtitle_pet_food": "Food for dogs, cats…",
"@product_type_subtitle_pet_food" : {
"description": "Example of products for pet food category"
},
"product_type_subtitle_product": "Smartphones, furniture…",
"@product_type_subtitle_product" : {
"description": "Example of products for other categories"
}
}
2 changes: 1 addition & 1 deletion packages/smooth_app/lib/pages/navigator/app_navigator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import 'package:smooth_app/pages/navigator/error_page.dart';
import 'package:smooth_app/pages/navigator/external_page.dart';
import 'package:smooth_app/pages/onboarding/onboarding_flow_navigator.dart';
import 'package:smooth_app/pages/preferences/user_preferences_page.dart';
import 'package:smooth_app/pages/product/add_new_product_page.dart';
import 'package:smooth_app/pages/product/add_new_product/add_new_product_page.dart';
import 'package:smooth_app/pages/product/edit_product_page.dart';
import 'package:smooth_app/pages/product/product_loader_page.dart';
import 'package:smooth_app/pages/product/product_page/new_product_header.dart';
Expand Down
2 changes: 1 addition & 1 deletion packages/smooth_app/lib/pages/offline_data_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import 'package:smooth_app/database/local_database.dart';
import 'package:smooth_app/generic_lib/design_constants.dart';
import 'package:smooth_app/generic_lib/duration_constants.dart';
import 'package:smooth_app/helpers/app_helper.dart';
import 'package:smooth_app/query/product_query.dart';
import 'package:smooth_app/pages/product/product_type_extensions.dart';
import 'package:smooth_app/widgets/smooth_app_bar.dart';
import 'package:smooth_app/widgets/smooth_scaffold.dart';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ import 'package:smooth_app/helpers/product_cards_helper.dart';
import 'package:smooth_app/pages/crop_parameters.dart';
import 'package:smooth_app/pages/image_crop_page.dart';
import 'package:smooth_app/pages/preferences/user_preferences_widgets.dart';
import 'package:smooth_app/pages/product/add_new_product/product_type_radio_list_tile.dart';
import 'package:smooth_app/pages/product/add_new_product_helper.dart';
import 'package:smooth_app/pages/product/common/product_dialog_helper.dart';
import 'package:smooth_app/pages/product/nutrition_page_loaded.dart';
import 'package:smooth_app/pages/product/product_field_editor.dart';
import 'package:smooth_app/pages/product/product_image_swipeable_view.dart';
import 'package:smooth_app/pages/product/product_type_extensions.dart';
import 'package:smooth_app/pages/product/simple_input_page_helpers.dart';
import 'package:smooth_app/query/product_query.dart';
import 'package:smooth_app/widgets/smooth_scaffold.dart';
Expand Down Expand Up @@ -96,7 +98,6 @@ class _AddNewProductPageState extends State<AddNewProductPage>
(widget.displayPictures ? 1 : 0);

double get _progress => (_pageNumber + 1) / _totalPages;

bool get _isLastPage => (_pageNumber + 1) == _totalPages;
ProductType? _inputProductType;
late ColorScheme _colorScheme;
Expand Down Expand Up @@ -576,15 +577,12 @@ class _AddNewProductPageState extends State<AddNewProductPage>

for (final ProductType productType in ProductType.values) {
rows.add(
RadioListTile<ProductType>(
title: Text(productType.getLabel(appLocalizations)),
onChanged: (ProductType? value) {
if (value != null) {
setState(() => _inputProductType = value);
}
ProductTypeRadioListTile(
productType: productType,
checked: productType == _inputProductType,
onChanged: (ProductType value) {
setState(() => _inputProductType = value);
},
value: productType,
groupValue: _inputProductType,
),
);
}
Expand Down
Loading
Loading