-
-
Notifications
You must be signed in to change notification settings - Fork 287
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: Exception when product brands are null #4699
fix: Exception when product brands are null #4699
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #4699 +/- ##
=======================================
Coverage 9.90% 9.90%
=======================================
Files 310 310
Lines 15815 15808 -7
=======================================
Hits 1566 1566
+ Misses 14249 14242 -7
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@WildOrangutan Please fix and attach issues #4692 #4693 #4694. |
Hm, I see some issues are related to my fix. Ok, will refactor and also fix those. |
fefaac7
to
179d581
Compare
9b68bda
to
04e17b0
Compare
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.
Thank you @WildOrangutan for your PR!
We'll even be better off with a systematic Widget getProductTitle
method.
Please have a look at my comments and tell me what you think.
packages/smooth_app/lib/pages/product/add_basic_details_page.dart
Outdated
Show resolved
Hide resolved
@@ -11,14 +11,22 @@ import 'package:smooth_app/helpers/image_field_extension.dart'; | |||
import 'package:smooth_app/helpers/ui_helpers.dart'; | |||
import 'package:smooth_app/query/product_query.dart'; | |||
|
|||
String getProductNameAndBrands( |
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.
String getProductNameAndBrands( | |
Widget getProductTitle( | |
final Product product, | |
final AppLocalizations appLocalizations, | |
) => Text( | |
getProductNameAndBrands(upToDateProduct, appLocalizations), | |
overflow: TextOverflow.ellipsis, | |
maxLines: 1, | |
); | |
String getProductNameAndBrands( |
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.
Named it buildProductTitle
, so it's hopefully gives a hint, that it returns different type, compared to getProductName
below.
04e17b0
to
3565a4d
Compare
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.
Thank you @WildOrangutan, looks good to me!
What
Fixing some null exception, that I randomly found while working on other issues, due to this bang operator:
widget.product.brands!
Fixes bug(s)
Fixes #4692, #4693, #4694