-
Notifications
You must be signed in to change notification settings - Fork 684
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
Constify inKino #76
Constify inKino #76
Conversation
), | ||
), | ||
)); | ||
const captionStyle = const TextStyle( |
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 this got a little longer, I would prefer to extract this into a new method so that it's easier to follow.
Something like:
Widget _buildCaption() {
...
if (_isExpandable) {
content.add(_buildExpandCollapsePrompt());
}
...
}
Widget _buildExpandCollapsePrompt() {
const captionStyle = const TextStyle(
fontSize: 12.0,
fontWeight: FontWeight.w600,
color: Colors.black54,
);
if (_isExpanded) {
return const Padding(
padding: const EdgeInsets.only(left: 4.0),
child: const Text('[touch to collapse]', style: captionStyle),
);
}
return const Padding(
padding: const EdgeInsets.only(left: 4.0),
child: const Text('[touch to expand]', style: captionStyle),
);
}
Thanks! I nitpicked about one tiny thing. |
Also, is there an analysis option or similar which automatically suggests using const instead of new where appropriate? |
…lot of missed consts >,<
Yes, I've added an example I've also added one more option in the language setting, this is a config necessary to make flutter work with the linter. Finally there is a commented out line too:
|
Thanks! The last commit actually made the Travis build fail, and it fails locally for me as well. Do you have time to either revert it or investigate how to test errors in Futures? If not, I'm happy to continue. |
That is very odd, I needed that change for the test to pass locally. Possibly due to slightly different flutter versions? |
Thanks a lot! Hopefully, I'll see you in I/O to thank in person! |
I've added
const
where it could be trivially swapped for new. I did indulge myself a little and swapped around widget construction instoryline_widget.dart
to make more of the text widgets const.Fixes #71