Skip to content
Snippets Groups Projects
Commit 52b5ab3d authored by Benoît Harrault's avatar Benoît Harrault
Browse files

Fix autosize text in buttons

parent 56cd86da
No related branches found
No related tags found
1 merge request!14Resolve "Fix autosize text in buttons"
Pipeline #7372 passed
## 0.8.1
- Fix autosized text in styled buttons
## 0.8.0 ## 0.8.0
- Allow multiline parameter item - Allow multiline parameter item
......
...@@ -2,8 +2,6 @@ import 'dart:math'; ...@@ -2,8 +2,6 @@ import 'dart:math';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:auto_size_text/auto_size_text.dart';
import 'package:flutter_custom_toolbox/utils/color_extensions.dart'; import 'package:flutter_custom_toolbox/utils/color_extensions.dart';
class StyledButton extends StatelessWidget { class StyledButton extends StatelessWidget {
...@@ -27,11 +25,13 @@ class StyledButton extends StatelessWidget { ...@@ -27,11 +25,13 @@ class StyledButton extends StatelessWidget {
required String caption, required String caption,
required Color color, required Color color,
}) { }) {
final Widget captionWidget = AutoSizeText( final Widget captionWidget = FittedBox(
fit: BoxFit.scaleDown,
child: Text(
caption, caption,
maxLines: 1,
style: TextStyle( style: TextStyle(
inherit: true, inherit: true,
fontSize: 99,
fontWeight: FontWeight.w900, fontWeight: FontWeight.w900,
color: color.darken(60), color: color.darken(60),
shadows: [ shadows: [
...@@ -57,6 +57,7 @@ class StyledButton extends StatelessWidget { ...@@ -57,6 +57,7 @@ class StyledButton extends StatelessWidget {
), ),
], ],
), ),
),
); );
return StyledButton( return StyledButton(
......
...@@ -3,7 +3,7 @@ description: "Flutter custom toolbox for org.benoitharrault.* projects." ...@@ -3,7 +3,7 @@ description: "Flutter custom toolbox for org.benoitharrault.* projects."
publish_to: "none" publish_to: "none"
version: 0.8.0 version: 0.8.1
homepage: https://git.harrault.fr/android/flutter-toolbox homepage: https://git.harrault.fr/android/flutter-toolbox
...@@ -16,7 +16,6 @@ dependencies: ...@@ -16,7 +16,6 @@ dependencies:
sdk: flutter sdk: flutter
# base # base
auto_size_text: ^3.0.0
easy_localization: ^3.0.1 easy_localization: ^3.0.1
equatable: ^2.0.5 equatable: ^2.0.5
flutter_bloc: ^8.1.1 flutter_bloc: ^8.1.1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment