diff --git a/CHANGELOG.md b/CHANGELOG.md index 867cbdbbc9f64028d0535245e9abd0e5cd0343b2..34944b960d6d76c836707f1cc7cd63a5a554e0a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.8.1 + +- Fix autosized text in styled buttons + ## 0.8.0 - Allow multiline parameter item diff --git a/lib/widgets/styled_button.dart b/lib/widgets/styled_button.dart index 2b0799147a6ea51315f694ae683583489274a939..a940d0e86b788e8f04ca1d90322563283fc84389 100644 --- a/lib/widgets/styled_button.dart +++ b/lib/widgets/styled_button.dart @@ -2,8 +2,6 @@ import 'dart:math'; import 'package:flutter/material.dart'; -import 'package:auto_size_text/auto_size_text.dart'; - import 'package:flutter_custom_toolbox/utils/color_extensions.dart'; class StyledButton extends StatelessWidget { @@ -27,35 +25,38 @@ class StyledButton extends StatelessWidget { required String caption, required Color color, }) { - final Widget captionWidget = AutoSizeText( - caption, - maxLines: 1, - style: TextStyle( - inherit: true, - fontWeight: FontWeight.w900, - color: color.darken(60), - shadows: [ - Shadow( - blurRadius: 5.0, - color: color.lighten(60), - offset: const Offset(2, 2), - ), - Shadow( - blurRadius: 5.0, - color: color.lighten(60), - offset: const Offset(2, -2), - ), - Shadow( - blurRadius: 5.0, - color: color.lighten(60), - offset: const Offset(-2, 2), - ), - Shadow( - blurRadius: 5.0, - color: color.lighten(60), - offset: const Offset(-2, -2), - ), - ], + final Widget captionWidget = FittedBox( + fit: BoxFit.scaleDown, + child: Text( + caption, + style: TextStyle( + inherit: true, + fontSize: 99, + fontWeight: FontWeight.w900, + color: color.darken(60), + shadows: [ + Shadow( + blurRadius: 5.0, + color: color.lighten(60), + offset: const Offset(2, 2), + ), + Shadow( + blurRadius: 5.0, + color: color.lighten(60), + offset: const Offset(2, -2), + ), + Shadow( + blurRadius: 5.0, + color: color.lighten(60), + offset: const Offset(-2, 2), + ), + Shadow( + blurRadius: 5.0, + color: color.lighten(60), + offset: const Offset(-2, -2), + ), + ], + ), ), ); diff --git a/pubspec.yaml b/pubspec.yaml index d98c82705f513eacc5ceacb00dcf8f1b9097f7c7..8707a1aa93b80400911310777aeeebd6923afa52 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: "Flutter custom toolbox for org.benoitharrault.* projects." publish_to: "none" -version: 0.8.0 +version: 0.8.1 homepage: https://git.harrault.fr/android/flutter-toolbox @@ -16,7 +16,6 @@ dependencies: sdk: flutter # base - auto_size_text: ^3.0.0 easy_localization: ^3.0.1 equatable: ^2.0.5 flutter_bloc: ^8.1.1