-
-
Notifications
You must be signed in to change notification settings - Fork 271
Bug: center multiline text in custom ChoiceChip #1848
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
Conversation
class _ChoiceChip extends StatelessWidget { | ||
const _ChoiceChip({ | ||
required this.title, | ||
this.subtitle, | ||
this.speed, | ||
required this.onTap, | ||
super.key, | ||
}); | ||
|
||
final Widget title; | ||
final Widget? subtitle; | ||
final Speed? speed; | ||
// Base class for choice chips. | ||
abstract class _ChoiceChip extends StatelessWidget { |
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.
IMO it's clearer this way, but I can revert this refactoring if you want.
The point of this change is to separate the logic dedicated to each component.
final String title; | ||
|
||
@override | ||
List<Widget> get children => [Text(title, textAlign: TextAlign.center)]; |
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.
All the fix is in the TextAlign.center
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.
Thanks for your contribution!
I think there are way too many lines changed in your PR for such a simple fix.
Normally you can add a textAlign: TextAlign.center
line 120 and that's it!
yep, it's explained why here: #1848 (comment) |
Done |
Thanks! |
Fixes #1750
Hi! This is my first contribution to this awesome app :)
I don't know if it is necessary to test the disposition of the quick game matrix.