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
- Allow multiline parameter item
......
......@@ -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),
),
],
),
),
);
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment