Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
flutter-toolbox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
android
flutter-toolbox
Commits
52b5ab3d
Commit
52b5ab3d
authored
4 months ago
by
Benoît Harrault
Browse files
Options
Downloads
Patches
Plain Diff
Fix autosize text in buttons
parent
56cd86da
No related branches found
No related tags found
1 merge request
!14
Resolve "Fix autosize text in buttons"
Pipeline
#7372
passed
4 months ago
Stage: build-debug
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.md
+4
-0
4 additions, 0 deletions
CHANGELOG.md
lib/widgets/styled_button.dart
+32
-31
32 additions, 31 deletions
lib/widgets/styled_button.dart
pubspec.yaml
+1
-2
1 addition, 2 deletions
pubspec.yaml
with
37 additions
and
33 deletions
CHANGELOG.md
+
4
−
0
View file @
52b5ab3d
## 0.8.1
-
Fix autosized text in styled buttons
## 0.8.0
-
Allow multiline parameter item
...
...
This diff is collapsed.
Click to expand it.
lib/widgets/styled_button.dart
+
32
−
31
View file @
52b5ab3d
...
...
@@ -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
),
),
],
),
),
);
...
...
This diff is collapsed.
Click to expand it.
pubspec.yaml
+
1
−
2
View file @
52b5ab3d
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment