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
8d76d37f
Unverified
Commit
8d76d37f
authored
Oct 03, 2018
by
jslavitz
Committed by
GitHub
Oct 03, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Choice Chip Fix (#22589)
* choice chip fix * added test
parent
2f6155bf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
77 additions
and
4 deletions
+77
-4
chip.dart
packages/flutter/lib/src/material/chip.dart
+4
-4
chip_test.dart
packages/flutter/test/material/chip_test.dart
+73
-0
No files found.
packages/flutter/lib/src/material/chip.dart
View file @
8d76d37f
...
...
@@ -575,7 +575,7 @@ class InputChip extends StatelessWidget
this
.
deleteIconColor
,
this
.
deleteButtonTooltipMessage
,
this
.
onPressed
,
this
.
pressElevation
,
this
.
pressElevation
=
8.0
,
this
.
disabledColor
,
this
.
selectedColor
,
this
.
tooltip
,
...
...
@@ -731,7 +731,7 @@ class ChoiceChip extends StatelessWidget
this
.
labelStyle
,
this
.
labelPadding
,
this
.
onSelected
,
this
.
pressElevation
,
this
.
pressElevation
=
8.0
,
@required
this
.
selected
,
this
.
selectedColor
,
this
.
disabledColor
,
...
...
@@ -908,7 +908,7 @@ class FilterChip extends StatelessWidget
this
.
labelPadding
,
this
.
selected
=
false
,
@required
this
.
onSelected
,
this
.
pressElevation
,
this
.
pressElevation
=
8.0
,
this
.
disabledColor
,
this
.
selectedColor
,
this
.
tooltip
,
...
...
@@ -1037,7 +1037,7 @@ class ActionChip extends StatelessWidget implements ChipAttributes, TappableChip
this
.
labelStyle
,
this
.
labelPadding
,
@required
this
.
onPressed
,
this
.
pressElevation
,
this
.
pressElevation
=
8.0
,
this
.
tooltip
,
this
.
shape
,
this
.
clipBehavior
=
Clip
.
none
,
...
...
packages/flutter/test/material/chip_test.dart
View file @
8d76d37f
...
...
@@ -1403,6 +1403,79 @@ void main() {
expect
(
deleted
,
true
);
});
testWidgets
(
'Chips can be tapped'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
const
MaterialApp
(
home:
Material
(
child:
ChoiceChip
(
selected:
false
,
label:
Text
(
'choice chip'
),
),
),
),
);
await
tester
.
tap
(
find
.
byType
(
ChoiceChip
));
expect
(
tester
.
takeException
(),
null
);
await
tester
.
pumpWidget
(
const
MaterialApp
(
home:
Material
(
child:
RawChip
(
selected:
false
,
label:
Text
(
'raw chip'
),
),
),
),
);
await
tester
.
tap
(
find
.
byType
(
RawChip
));
expect
(
tester
.
takeException
(),
null
);
await
tester
.
pumpWidget
(
MaterialApp
(
home:
Material
(
child:
ActionChip
(
onPressed:
(){},
label:
const
Text
(
'action chip'
),
),
),
),
);
await
tester
.
tap
(
find
.
byType
(
ActionChip
));
expect
(
tester
.
takeException
(),
null
);
await
tester
.
pumpWidget
(
MaterialApp
(
home:
Material
(
child:
FilterChip
(
onSelected:
(
bool
valueChanged
){},
selected:
false
,
label:
const
Text
(
'filter chip'
),
),
),
),
);
await
tester
.
tap
(
find
.
byType
(
FilterChip
));
expect
(
tester
.
takeException
(),
null
);
await
tester
.
pumpWidget
(
const
MaterialApp
(
home:
Material
(
child:
InputChip
(
selected:
false
,
label:
Text
(
'input chip'
),
),
),
),
);
await
tester
.
tap
(
find
.
byType
(
InputChip
));
expect
(
tester
.
takeException
(),
null
);
});
testWidgets
(
'Chip elevation works correctly'
,
(
WidgetTester
tester
)
async
{
final
ThemeData
theme
=
ThemeData
(
platform:
TargetPlatform
.
android
,
...
...
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