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
Merge requests
!14
Resolve "Fix autosize text in buttons"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "Fix autosize text in buttons"
16-fix-autosize-text-in-buttons
into
master
Overview
0
Commits
1
Pipelines
2
Changes
3
Merged
Benoît Harrault
requested to merge
16-fix-autosize-text-in-buttons
into
master
6 months ago
Overview
0
Commits
1
Pipelines
2
Changes
3
Expand
Closes
#16 (closed)
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
52b5ab3d
1 commit,
5 months ago
3 files
+
37
−
33
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
lib/widgets/styled_button.dart
+
32
−
31
Options
@@ -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
),
),
],
),
),
);
Loading