-
-
Notifications
You must be signed in to change notification settings - Fork 368
fix: Removed the option to add an item through barcode from Add a Price page #6525
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
base: develop
Are you sure you want to change the base?
Changes from all commits
bb593c7
5eb1277
e7db4aa
c6e163c
623a33c
a29fc07
d0e14b0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -19,12 +19,14 @@ class PriceModel with ChangeNotifier { | |||||||||||||||||||
required final List<OsmLocation>? locations, | ||||||||||||||||||||
required final Currency currency, | ||||||||||||||||||||
final PriceMetaProduct? initialProduct, | ||||||||||||||||||||
final bool? multipleProducts, | ||||||||||||||||||||
}) : _proof = null, | ||||||||||||||||||||
existingPrices = null, | ||||||||||||||||||||
_proofType = proofType, | ||||||||||||||||||||
_date = DateTime.now(), | ||||||||||||||||||||
_currency = currency, | ||||||||||||||||||||
_locations = locations, | ||||||||||||||||||||
_multipleProducts = multipleProducts ?? false, | ||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||
_priceAmountModels = <PriceAmountModel>[ | ||||||||||||||||||||
if (initialProduct != null) PriceAmountModel(product: initialProduct), | ||||||||||||||||||||
]; | ||||||||||||||||||||
|
@@ -50,6 +52,14 @@ class PriceModel with ChangeNotifier { | |||||||||||||||||||
return false; | ||||||||||||||||||||
} | ||||||||||||||||||||
|
||||||||||||||||||||
late bool _multipleProducts; | ||||||||||||||||||||
bool showAddProductCard() { | ||||||||||||||||||||
if (_multipleProducts == true) { | ||||||||||||||||||||
return true; | ||||||||||||||||||||
} | ||||||||||||||||||||
return false; | ||||||||||||||||||||
} | ||||||||||||||||||||
|
||||||||||||||||||||
Comment on lines
+55
to
+62
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
For the record, your previous syntax was a bit heavy: bool showAddProductCard() {
if (_multipleProducts == true) {
return true;
}
return false;
} The following would have been better: bool get showAddProductCard => _multipleProducts; |
||||||||||||||||||||
void setProof(final Proof proof, {final bool init = false}) { | ||||||||||||||||||||
if (!init) { | ||||||||||||||||||||
_hasChanged = true; | ||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -38,6 +38,7 @@ class ProductPriceAddPage extends StatefulWidget { | |||||
required final BuildContext context, | ||||||
final PriceMetaProduct? product, | ||||||
required final ProofType proofType, | ||||||
final bool? multiProduct, | ||||||
}) async { | ||||||
if (!await ProductRefresher().checkIfLoggedIn( | ||||||
context, | ||||||
|
@@ -65,6 +66,7 @@ class ProductPriceAddPage extends StatefulWidget { | |||||
locations: osmLocations, | ||||||
initialProduct: product, | ||||||
currency: currency, | ||||||
multipleProducts: multiProduct, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Please try to keep consistency between classes. |
||||||
), | ||||||
), | ||||||
), | ||||||
|
@@ -152,7 +154,7 @@ class _ProductPriceAddPageState extends State<ProductPriceAddPage> | |||||
index: i, | ||||||
), | ||||||
const SizedBox(height: LARGE_SPACE), | ||||||
const PriceAddProductCard(), | ||||||
if (model.showAddProductCard()) const PriceAddProductCard(), | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
// so that the last items don't get hidden by the FAB | ||||||
const SizedBox(height: MINIMUM_TOUCH_SIZE * 2), | ||||||
], | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.