这是indexloc提供的服务,不要输入任何密码
Skip to content

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

Merged
merged 5 commits into from
Jun 9, 2025

Conversation

Axl-Lvy
Copy link
Contributor

@Axl-Lvy Axl-Lvy commented Jun 8, 2025

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.

image

Comment on lines 142 to 136
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 {
Copy link
Contributor Author

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)];
Copy link
Contributor Author

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

Copy link
Contributor

@veloce veloce left a 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!

@Axl-Lvy
Copy link
Contributor Author

Axl-Lvy commented Jun 9, 2025

yep, it's explained why here: #1848 (comment)
let me revert it

@Axl-Lvy
Copy link
Contributor Author

Axl-Lvy commented Jun 9, 2025

Done

@veloce veloce merged commit 00f94b4 into lichess-org:main Jun 9, 2025
1 check passed
@veloce
Copy link
Contributor

veloce commented Jun 9, 2025

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

quick pairing: translated "Custom" Text not centralized in tile
2 participants