From 9fcd919847cd2c1740c00be179896c8de78924a4 Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Tue, 1 Jul 2025 21:29:10 +0200 Subject: [PATCH] Implemented FittedBox Widget --- lib/views/round_view.dart | 22 ++++++++++++---------- pubspec.yaml | 3 ++- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/lib/views/round_view.dart b/lib/views/round_view.dart index b945ec4..b1b98e3 100644 --- a/lib/views/round_view.dart +++ b/lib/views/round_view.dart @@ -123,19 +123,21 @@ class _RoundViewState extends State { index, Padding( padding: EdgeInsets.symmetric( - horizontal: + horizontal: 4 + _getSegmendetControlPadding(maxLength), vertical: 6, ), - child: Text( - name, - textAlign: TextAlign.center, - maxLines: 1, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: _getSegmendetControlFontSize( - widget.gameSession - .getMaxLengthOfPlayerNames()), + child: FittedBox( + fit: BoxFit.scaleDown, + child: Text( + name, + textAlign: TextAlign.center, + maxLines: 1, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: _getSegmendetControlFontSize( + maxLength), + ), ), ), ), diff --git a/pubspec.yaml b/pubspec.yaml index ffc7346..0ba04e5 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: cabo_counter description: "Mobile app for the card game Cabo" publish_to: 'none' -version: 0.3.2+248 +version: 0.3.3+255 environment: sdk: ^3.5.4 @@ -26,6 +26,7 @@ dependencies: sdk: flutter intl: any syncfusion_flutter_charts: ^30.1.37 + auto_size_text: ^3.0.0 dev_dependencies: flutter_test: