Skip to content

Commit

Permalink
feat: 2910 - big UI/UX refactoring (#4054)
Browse files Browse the repository at this point in the history
Impacted files:
* `add_new_product_page.dart`: big refactoring
* `add_simple_input_button.dart`: refactoring
* `app_en.arb`: added 5 labels
* `app_fr.arb`: added 5 labels
* `smooth_large_button_with_icon.dart`: added an optional image file to display in RRect
  • Loading branch information
monsieurtanuki committed Jun 1, 2023
1 parent efb8c0c commit dbf4c32
Show file tree
Hide file tree
Showing 5 changed files with 215 additions and 143 deletions.
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
import 'dart:io';

import 'package:auto_size_text/auto_size_text.dart';
import 'package:flutter/material.dart';
import 'package:smooth_app/generic_lib/buttons/smooth_simple_button.dart';
import 'package:smooth_app/generic_lib/design_constants.dart';

class SmoothLargeButtonWithIcon extends StatelessWidget {
const SmoothLargeButtonWithIcon({
required this.text,
required this.icon,
required this.onPressed,
this.padding,
this.imageFile,
});

final String text;
final IconData icon;
final VoidCallback onPressed;
final EdgeInsets? padding;
final File? imageFile;

@override
Widget build(BuildContext context) {
Expand Down Expand Up @@ -42,6 +47,16 @@ class SmoothLargeButtonWithIcon extends StatelessWidget {
),
),
const Spacer(),
if (imageFile != null)
SizedBox(
height: 50,
width: 50,
child: ClipRRect(
borderRadius: ROUNDED_BORDER_RADIUS,
child: Image.file(imageFile!, fit: BoxFit.cover),
),
),
if (imageFile != null) const Spacer(),
],
),
);
Expand Down
5 changes: 5 additions & 0 deletions packages/smooth_app/lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,11 @@
"@nutritional_facts_photo_button_label": {},
"nutritional_facts_input_button_label": "Input nutrition facts",
"nutritional_facts_added": "Nutrition facts added",
"categories_added": "Categories added",
"new_product_title_nutriscore": "Help compute the Nutri-Score in 2 minutes.",
"new_product_title_ecoscore": "Help compute the Eco-Score in 2 minutes.",
"new_product_title_pictures": "Let's take some pictures!",
"new_product_title_misc": "And some basic data…",
"nutritional_facts_photo_uploaded": "Nutrition facts photo uploaded",
"@nutritional_facts_photo_uploaded": {},
"recycling_photo_button_label": "Recycling information photo",
Expand Down
5 changes: 5 additions & 0 deletions packages/smooth_app/lib/l10n/app_fr.arb
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,11 @@
"@nutritional_facts_photo_button_label": {},
"nutritional_facts_input_button_label": "Saisir les informations nutritionnelles",
"nutritional_facts_added": "Informations nutritionnelles ajoutées",
"categories_added": "Catégories ajoutées",
"new_product_title_nutriscore": "Calculez le Nutri-Score en 2 minutes.",
"new_product_title_ecoscore": "Calculez l'Eco-Score en 2 minutes.",
"new_product_title_pictures": "Prenez quelques photos",
"new_product_title_misc": "Quelques données générales…",
"nutritional_facts_photo_uploaded": "Photo des informations nutritionnelles téléchargée",
"@nutritional_facts_photo_uploaded": {},
"recycling_photo_button_label": "Photo des informations de recyclage",
Expand Down

0 comments on commit dbf4c32

Please sign in to comment.