-
-
Notifications
You must be signed in to change notification settings - Fork 313
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
feat: Step-by-step fast-track #4698
feat: Step-by-step fast-track #4698
Conversation
Perfect, before reviewing your code, could you:
|
Okay |
Yes exactly, basically for the first one, you juste need to use the parent |
…into prodinfodesignchange
…k/smooth-app into prodinfodesignchange
I have committed the changes. WhatsApp.Video.2023-10-06.at.1.48.22.AM.mp4Let me know if these are okay or not :) |
Perfect in terms of UI |
); | ||
|
||
// await Navigator.push<void>( |
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.
Why do you comment this code?
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.
It was the previous code that opened the AddProductInformation page with the Tabs Below it.
So I Commented it and added new code Above it just to open that page from Parent Navigator.
Should I Remove that commented code?
@@ -42,7 +40,7 @@ class SmoothLargeButtonWithIcon extends StatelessWidget { | |||
|
|||
return SmoothSimpleButton( | |||
minWidth: double.infinity, | |||
padding: padding ?? const EdgeInsets.all(10), | |||
padding: padding ?? const EdgeInsets.symmetric(vertical: 10), |
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.
By changing this button, it will have an impact on the whole app.
Please provide specific values when you need it.
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.
Actually in figma design those buttons' horizontal padding was slightly high that is why i made this change.
However i will revert back to the original, no issue.
@@ -17,7 +17,7 @@ const double MINIMUM_TOUCH_SIZE = kMinInteractiveDimension; | |||
const double DEFAULT_ICON_SIZE = 24.0; | |||
|
|||
/// Background, e.g SmoothCard | |||
const Radius ROUNDED_RADIUS = Radius.circular(20.0); | |||
const Radius ROUNDED_RADIUS = Radius.circular(10.0); |
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.
By changing this button, it will have an impact on the whole app.
Please provide specific radiuses when you need it.
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.
Okay, in Figma the corners looked less than 20px,
However, I will revert back to the original.
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: <Widget>[ | ||
/*if (widget.displayPictures) _buildCard(_getImageRows(context)), |
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.
Same question as before, why do you comment this code?
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.
Oh Sorry, I will remove that comment.
That commented part is used from the Line Number : 230
|
||
Widget _backButton() { | ||
return Container( | ||
margin: const EdgeInsets.only(left: 10, right: 10, top: 10), |
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.
Please use EdgeInsetsDirectional instead
return Container( | ||
margin: const EdgeInsets.only(left: 10, right: 10, top: 10), | ||
width: 20, | ||
height: 20, |
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.
ues, by convention, please write it as 20.0
onPressed: () { | ||
_onWillPop().then((bool leaveThePage) => leaveThePage ? Navigator.of(context).pop() : null); | ||
}, | ||
child: const Text('Cancel', style: TextStyle(color: Colors.black, fontSize: 20, fontWeight: FontWeight.bold)), |
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.
Please don't hardcode i11n
Hey @g123k , I have committed the Reviewed changes. Can you please go through that? Thanks :) |
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.
Please use the double format + trailing commas + don't hardcode values
Tkx
child: Text(appLocalizations.new_product_additional_ecoscore, | ||
style: TextStyle( | ||
color: Theme.of(context).colorScheme.onPrimary))), | ||
const SizedBox(width: 5), |
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.
double
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.
Done
child: Row(children: <Widget>[ | ||
Icon(Icons.filter_2, | ||
color: Theme.of(context).colorScheme.onPrimary), | ||
const SizedBox(width: 15), |
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.
double
title: Text(appLocalizations.new_product_additional_ecoscore), | ||
trailing: Icon( | ||
_ecoscoreExpanded ? Icons.expand_less : Icons.expand_more, | ||
const SizedBox(height: 15), |
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.
double
@@ -296,20 +390,39 @@ class _AddNewProductPageState extends State<AddNewProductPage> | |||
final Attribute? attribute = _getAttribute(Attribute.ATTRIBUTE_ECOSCORE); | |||
return <Widget>[ | |||
AddNewProductTitle(appLocalizations.new_product_title_ecoscore), | |||
const SizedBox(height: 15), |
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.
double
List<Widget> _getNutriscoreRows(final BuildContext context) { | ||
final AppLocalizations appLocalizations = AppLocalizations.of(context); | ||
final Attribute? attribute = _getAttribute(Attribute.ATTRIBUTE_NUTRISCORE); | ||
return <Widget>[ | ||
AddNewProductTitle(appLocalizations.new_product_title_nutriscore), | ||
const SizedBox(height: 15), |
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.
double
icon: const Icon(Icons.arrow_back))); | ||
} | ||
|
||
Widget _getButtons({String doneBtnText = 'Next'}) { |
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.
No hardcoded sentence, please
children: <Widget>[ | ||
ElevatedButton( | ||
style: ElevatedButton.styleFrom( | ||
minimumSize: Size(MediaQuery.of(context).size.width * 0.35, 40), |
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.
double
minimumSize: Size(MediaQuery.of(context).size.width * 0.35, 40), | ||
backgroundColor: Theme.of(context).colorScheme.secondary, | ||
shape: RoundedRectangleBorder( | ||
borderRadius: BorderRadius.circular(20))), |
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.
double + trailing comma
fontSize: 20, | ||
fontWeight: FontWeight.bold)), |
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.
double + trailing comma
fontSize: 20, | ||
fontWeight: FontWeight.bold)), | ||
), | ||
const SizedBox(width: 10), |
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.
double
Codecov Report
@@ Coverage Diff @@
## develop #4698 +/- ##
==========================================
- Coverage 9.90% 9.86% -0.04%
==========================================
Files 310 310
Lines 15815 15871 +56
==========================================
Hits 1566 1566
- Misses 14249 14305 +56
... and 7 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Hey @g123k , I have made the changes & Committed, Let me know if any other changes need to be made :) |
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.
A few last comments
const SizedBox(height: MINIMUM_TOUCH_SIZE), | ||
], | ||
), | ||
body: SafeArea( |
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.
Why do you get rid of the Scaffold
?
One of the goals is to have a consustent color for the status bar on Android and iOS
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.
@surajitbasak Any reason?
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.
Any reason for?
This the way all screens are implemented in the app
decoration: BoxDecoration( | ||
gradient: LinearGradient( | ||
colors: <Color>[ | ||
Theme.of(context).colorScheme.inversePrimary, |
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.
When you call of(context)
several times, please ensure to cache this (by storing it in a variable)
margin: EdgeInsets.zero, | ||
elevation: 15.0, | ||
child: SizedBox( | ||
height: MediaQuery.of(context).size.height * 0.1, |
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.
Now that we use the latest version of Flutter, you can simplify by using MediaQuery.sizeOf()
Widget _backButton() { | ||
return Container( | ||
margin: const EdgeInsetsDirectional.only( | ||
start: 10.0, end: 10.0, top: 10.0, bottom: 0.0), |
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.
Please add the missing trailing comma at the end
ElevatedButton( | ||
style: ElevatedButton.styleFrom( | ||
minimumSize: Size(MediaQuery.of(context).size.width * 0.35, 40.0), | ||
backgroundColor: Theme.of(context).colorScheme.secondary, |
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.
Same comment here for of()
+ MediaQuery
ElevatedButton( | ||
style: ElevatedButton.styleFrom( | ||
minimumSize: Size(MediaQuery.of(context).size.width * 0.35, 40.0), | ||
backgroundColor: const Color(0xFF341100), |
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.
Please make this color a constant
onPressed: () { | ||
_pageController.nextPage( | ||
duration: SmoothAnimationsDuration.short, | ||
curve: Curves.easeOut); |
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.
Please add the trailing comma
Hey @g123k , I have committed the changes, Let me know if it's okay or not :) |
|
||
@override | ||
void didChangeDependencies() { | ||
print('Mummy di'); |
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.
No print please
and why do you need to fetch the colorScheme
here?
Edit: Just get it at the beginning of the build()
method
@g123k , i made the changes, please check once :) |
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final AppLocalizations appLocalizations = AppLocalizations.of(context); | ||
_colorScheme = _colorScheme = Theme.of(context).colorScheme; |
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.
Perfect, please just remove the attribute from the class, as it's not used anymore
const SizedBox(height: MINIMUM_TOUCH_SIZE), | ||
], | ||
), | ||
body: SafeArea( |
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.
@surajitbasak Any reason?
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.
Just 2 comments
Do you make any progress on this PR @surajitbasak? |
No i didn't make any further changes, |
style: const TextStyle( | ||
fontSize: 18.0, | ||
fontWeight: FontWeight.bold, | ||
), |
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.
That wont look good on small devices, please use
Theme.of(context).textTheme.displaySmall
or another one which is most fitting and edit it with .copyWith()
@surajitbasak could you fix the 3 little merge conflicts, so that we can rebase the PR ? |
I have resolved those merge conflicts, Please let me know if i need to do anything else :) |
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.
OK, let's go for this PR.
In the case, where there are some changes required, I will open a new PR.
Product Design page is now split into multiple pages
Product.Design.Recording.mp4
Let me know if I have made any mistakes or anything need to be changed further