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

fix: Finish button replaced with FAB #3219

Merged
merged 19 commits into from
Oct 28, 2022
Merged
Changes from 16 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
bc52e3b
Update assets
prathamsoni11 Oct 3, 2022
1e9c2b4
Merge pull request #6 from prathamsoni11/auto-update-assets
prathamsoni11 Oct 4, 2022
19e5564
Merge branch 'develop' of https://github.com/prathamsoni11/smooth-app…
prathamsoni11 Oct 10, 2022
8456a4a
Merge branch 'openfoodfacts:develop' into develop
prathamsoni11 Oct 11, 2022
625ea11
Merge branch 'openfoodfacts:develop' into develop
prathamsoni11 Oct 11, 2022
5c1d2ba
Merge branch 'develop' of https://github.com/prathamsoni11/smooth-app…
prathamsoni11 Oct 12, 2022
a80e2fc
Merge branch 'develop' of https://github.com/prathamsoni11/smooth-app…
prathamsoni11 Oct 19, 2022
542c472
Merge branch 'develop' of https://github.com/prathamsoni11/smooth-app…
prathamsoni11 Oct 20, 2022
c395057
Merge branch 'develop' of https://github.com/prathamsoni11/smooth-app…
prathamsoni11 Oct 21, 2022
e6ffbf0
Merge branch 'openfoodfacts:develop' into develop
prathamsoni11 Oct 23, 2022
bc79635
Merge branch 'openfoodfacts:develop' into develop
prathamsoni11 Oct 24, 2022
7ae9401
Merge branch 'openfoodfacts:develop' into develop
prathamsoni11 Oct 25, 2022
dc5f878
Merge branch 'openfoodfacts:develop' into develop
prathamsoni11 Oct 26, 2022
a3e6306
changed button with FAB
prathamsoni11 Oct 26, 2022
2c246aa
moved FAB in SmoothScaffold
prathamsoni11 Oct 27, 2022
14e66f7
removed stack
prathamsoni11 Oct 27, 2022
8e4884f
Merge branch 'develop' into finish_button
monsieurtanuki Oct 28, 2022
8e7f0c4
Update add_new_product_page.dart
monsieurtanuki Oct 28, 2022
b69f077
Merge branch 'develop' into finish_button
monsieurtanuki Oct 28, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 35 additions & 47 deletions packages/smooth_app/lib/pages/product/add_new_product_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,56 +75,44 @@ class _AddNewProductPageState extends State<AddNewProductPage> {
start: VERY_LARGE_SPACE,
end: VERY_LARGE_SPACE,
),
child: Stack(
children: <Widget>[
SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
appLocalizations.add_product_take_photos_descriptive,
style: themeData.textTheme.bodyText1!
.apply(color: themeData.colorScheme.onBackground),
),
..._buildImageCaptureRows(context),
_buildNutritionInputButton(product),
_buildaddInputDetailsButton()
],
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
appLocalizations.add_product_take_photos_descriptive,
style: themeData.textTheme.bodyText1!
.apply(color: themeData.colorScheme.onBackground),
),
),
Positioned(
child: Align(
alignment: Alignment.bottomCenter,
child: SmoothActionButtonsBar.single(
action: SmoothActionButton(
text: appLocalizations.finish,
onPressed: () async {
final LocalDatabase localDatabase =
context.read<LocalDatabase>();
final DaoProduct daoProduct =
DaoProduct(localDatabase);
final Product? localProduct =
await daoProduct.get(widget.barcode);
if (localProduct == null) {
product = Product(
barcode: widget.barcode,
);
daoProduct.put(product);
localDatabase.notifyListeners();
}
provider.set(product);
if (mounted) {
await Navigator.maybePop(context,
_isProductLoaded ? widget.barcode : null);
}
},
),
),
),
),
],
..._buildImageCaptureRows(context),
_buildNutritionInputButton(product),
_buildaddInputDetailsButton()
],
),
),
),
floatingActionButton: FloatingActionButton.extended(
onPressed: () async {
final LocalDatabase localDatabase = context.read<LocalDatabase>();
final DaoProduct daoProduct = DaoProduct(localDatabase);
final Product? localProduct =
await daoProduct.get(widget.barcode);
if (localProduct == null) {
product = Product(
barcode: widget.barcode,
);
daoProduct.put(product);
localDatabase.notifyListeners();
}
provider.set(product);
if (mounted) {
await Navigator.maybePop(
context, _isProductLoaded ? widget.barcode : null);
}
},
label: Text(appLocalizations.finish),
icon: const Icon(Icons.done),
),
);
},
);
Expand Down