Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
5a27340c
Unverified
Commit
5a27340c
authored
Mar 12, 2021
by
Jonathan Lau
Committed by
GitHub
Mar 12, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add minWidth constraint to RawChip when materialTapTargetSize is padded (#77881)
parent
180bb8c1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
1 deletion
+26
-1
chip.dart
packages/flutter/lib/src/material/chip.dart
+4
-1
chip_test.dart
packages/flutter/test/material/chip_test.dart
+22
-0
No files found.
packages/flutter/lib/src/material/chip.dart
View file @
5a27340c
...
@@ -2022,7 +2022,10 @@ class _RawChipState extends State<RawChip> with TickerProviderStateMixin<RawChip
...
@@ -2022,7 +2022,10 @@ class _RawChipState extends State<RawChip> with TickerProviderStateMixin<RawChip
final
Offset
densityAdjustment
=
(
widget
.
visualDensity
??
theme
.
visualDensity
).
baseSizeAdjustment
;
final
Offset
densityAdjustment
=
(
widget
.
visualDensity
??
theme
.
visualDensity
).
baseSizeAdjustment
;
switch
(
widget
.
materialTapTargetSize
??
theme
.
materialTapTargetSize
)
{
switch
(
widget
.
materialTapTargetSize
??
theme
.
materialTapTargetSize
)
{
case
MaterialTapTargetSize
.
padded
:
case
MaterialTapTargetSize
.
padded
:
constraints
=
BoxConstraints
(
minHeight:
kMinInteractiveDimension
+
densityAdjustment
.
dy
);
constraints
=
BoxConstraints
(
minWidth:
kMinInteractiveDimension
+
densityAdjustment
.
dx
,
minHeight:
kMinInteractiveDimension
+
densityAdjustment
.
dy
,
);
break
;
break
;
case
MaterialTapTargetSize
.
shrinkWrap
:
case
MaterialTapTargetSize
.
shrinkWrap
:
constraints
=
const
BoxConstraints
();
constraints
=
const
BoxConstraints
();
...
...
packages/flutter/test/material/chip_test.dart
View file @
5a27340c
...
@@ -500,6 +500,28 @@ void main() {
...
@@ -500,6 +500,28 @@ void main() {
expect
(
tester
.
getSize
(
find
.
byType
(
Chip
)),
const
Size
(
800.0
,
48.0
));
expect
(
tester
.
getSize
(
find
.
byType
(
Chip
)),
const
Size
(
800.0
,
48.0
));
});
});
testWidgets
(
'Chip responds to materialTapTargetSize'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
_wrapForChip
(
child:
Column
(
children:
const
<
Widget
>[
Chip
(
label:
Text
(
'X'
),
materialTapTargetSize:
MaterialTapTargetSize
.
padded
,
),
Chip
(
label:
Text
(
'X'
),
materialTapTargetSize:
MaterialTapTargetSize
.
shrinkWrap
,
),
],
),
),
);
expect
(
tester
.
getSize
(
find
.
byType
(
Chip
).
first
),
const
Size
(
48.0
,
48.0
));
expect
(
tester
.
getSize
(
find
.
byType
(
Chip
).
last
),
const
Size
(
38.0
,
32.0
));
},
);
testWidgets
(
'Chip elements are ordered horizontally for locale'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Chip elements are ordered horizontally for locale'
,
(
WidgetTester
tester
)
async
{
final
UniqueKey
iconKey
=
UniqueKey
();
final
UniqueKey
iconKey
=
UniqueKey
();
final
Widget
test
=
Overlay
(
final
Widget
test
=
Overlay
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment