-
-
Notifications
You must be signed in to change notification settings - Fork 286
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
New file: * `edit_product_page.dart`: Page where we can indirectly edit all data about a product. Impacted files: * `new_product_page.dart`: added a button that calls the new `EditProductPage` * `Podfile.lock`
- Loading branch information
1 parent
3f39190
commit 90c1f63
Showing
3 changed files
with
77 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
packages/smooth_app/lib/pages/product/edit_product_page.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:openfoodfacts/model/Product.dart'; | ||
|
||
/// Page where we can indirectly edit all data about a product. | ||
class EditProductPage extends StatelessWidget { | ||
const EditProductPage(this.product); | ||
|
||
final Product product; | ||
|
||
// TODO(monsieurtanuki): translations | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
appBar: AppBar(title: Text(product.productName!)), | ||
body: ListView( | ||
children: <ListTile>[ | ||
ListTile( | ||
title: const Text('Basic details'), | ||
subtitle: const Text('Product name, brand, quantity'), | ||
leading: _getLeadingWidget(), | ||
), | ||
ListTile( | ||
title: const Text('Photos'), | ||
subtitle: const Text('Add or refresh photos'), | ||
leading: _getLeadingWidget(), | ||
), | ||
ListTile( | ||
title: const Text('Labels & Certifications'), | ||
subtitle: const Text('Environmental, Quality labels, ...'), | ||
leading: _getLeadingWidget(), | ||
), | ||
ListTile( | ||
title: const Text('Ingredients & Origins'), | ||
leading: _getLeadingWidget(), | ||
), | ||
ListTile( | ||
title: const Text('Packaging'), | ||
leading: _getLeadingWidget(), | ||
), | ||
ListTile( | ||
title: const Text('Nutrition facts'), | ||
subtitle: const Text('Nutrition, alcohol content, ...'), | ||
leading: _getLeadingWidget(), | ||
), | ||
], | ||
), | ||
); | ||
} | ||
|
||
Widget _getLeadingWidget() => ElevatedButton( | ||
child: const Text('Edit'), | ||
onPressed: () {}, | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters