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
ba489607
Unverified
Commit
ba489607
authored
Sep 19, 2022
by
Darren Austin
Committed by
GitHub
Sep 19, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed an issue with FilterChip's changing size when selected due to border size. (#111916)
parent
7f6c111c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
3 deletions
+44
-3
filter_chip_template.dart
dev/tools/gen_defaults/lib/filter_chip_template.dart
+1
-1
choice_chip.dart
packages/flutter/lib/src/material/choice_chip.dart
+2
-1
filter_chip.dart
packages/flutter/lib/src/material/filter_chip.dart
+2
-1
filter_chip_test.dart
packages/flutter/test/material/filter_chip_test.dart
+39
-0
No files found.
dev/tools/gen_defaults/lib/filter_chip_template.dart
View file @
ba489607
...
...
@@ -57,7 +57,7 @@ class _${blockName}DefaultsM3 extends ChipThemeData {
? isEnabled
?
${border('$tokenGroup$variant.unselected.outline')}
:
${border('$tokenGroup$variant.disabled.unselected.outline')}
:
null
;
:
const BorderSide(color: Colors.transparent)
;
@override
IconThemeData? get iconTheme => IconThemeData(
...
...
packages/flutter/lib/src/material/choice_chip.dart
View file @
ba489607
...
...
@@ -7,6 +7,7 @@ import 'package:flutter/widgets.dart';
import
'chip.dart'
;
import
'chip_theme.dart'
;
import
'colors.dart'
;
import
'debug.dart'
;
import
'theme.dart'
;
import
'theme_data.dart'
;
...
...
@@ -236,7 +237,7 @@ class _ChoiceChipDefaultsM3 extends ChipThemeData {
?
isEnabled
?
BorderSide
(
color:
Theme
.
of
(
context
).
colorScheme
.
outline
)
:
BorderSide
(
color:
Theme
.
of
(
context
).
colorScheme
.
onSurface
.
withOpacity
(
0.12
))
:
null
;
:
const
BorderSide
(
color:
Colors
.
transparent
)
;
@override
IconThemeData
?
get
iconTheme
=>
IconThemeData
(
...
...
packages/flutter/lib/src/material/filter_chip.dart
View file @
ba489607
...
...
@@ -7,6 +7,7 @@ import 'package:flutter/widgets.dart';
import
'chip.dart'
;
import
'chip_theme.dart'
;
import
'colors.dart'
;
import
'debug.dart'
;
import
'theme.dart'
;
import
'theme_data.dart'
;
...
...
@@ -245,7 +246,7 @@ class _FilterChipDefaultsM3 extends ChipThemeData {
?
isEnabled
?
BorderSide
(
color:
Theme
.
of
(
context
).
colorScheme
.
outline
)
:
BorderSide
(
color:
Theme
.
of
(
context
).
colorScheme
.
onSurface
.
withOpacity
(
0.12
))
:
null
;
:
const
BorderSide
(
color:
Colors
.
transparent
)
;
@override
IconThemeData
?
get
iconTheme
=>
IconThemeData
(
...
...
packages/flutter/test/material/filter_chip_test.dart
View file @
ba489607
...
...
@@ -172,4 +172,43 @@ void main() {
await
tester
.
pumpWidget
(
wrapForChip
(
child:
FilterChip
(
label:
label
,
onSelected:
(
bool
b
)
{
},
clipBehavior:
Clip
.
antiAlias
)));
checkChipMaterialClipBehavior
(
tester
,
Clip
.
antiAlias
);
});
testWidgets
(
'M3 width should not change with selection'
,
(
WidgetTester
tester
)
async
{
// Regression tests for: https://github.com/flutter/flutter/issues/110645
// For the text "FilterChip" the chip should default to 175 regardless of selection.
const
int
expectedWidth
=
175
;
// Unselected
await
tester
.
pumpWidget
(
MaterialApp
(
theme:
ThemeData
(
useMaterial3:
true
),
home:
Material
(
child:
Center
(
child:
FilterChip
(
label:
const
Text
(
'FilterChip'
),
showCheckmark:
false
,
onSelected:
(
bool
_
)
{},
)
),
),
));
expect
(
tester
.
getSize
(
find
.
byType
(
FilterChip
)).
width
,
expectedWidth
);
// Selected
await
tester
.
pumpWidget
(
MaterialApp
(
theme:
ThemeData
(
useMaterial3:
true
),
home:
Material
(
child:
Center
(
child:
FilterChip
(
label:
const
Text
(
'FilterChip'
),
showCheckmark:
false
,
selected:
true
,
onSelected:
(
bool
_
)
{},
)
),
),
));
await
tester
.
pumpAndSettle
();
expect
(
tester
.
getSize
(
find
.
byType
(
FilterChip
)).
width
,
expectedWidth
);
});
}
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