Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
39cd943
add semantic container, selectability, and enabled state to chip
May 25, 2018
cf8a1c3
add tests for chip semantics
May 25, 2018
07d5e9b
Merge branch 'master' of github.com:flutter/flutter into a11y_16964
May 29, 2018
42402a1
add more test coverage, make sure hasEnabledState is present
May 29, 2018
be5801f
update tests and use canTap
May 29, 2018
ef41d7f
increase tap target using outer padding
May 30, 2018
2a9a87e
changed outer padding to outer constraints, update some tests
May 31, 2018
5a90a0e
increase time picker height by 12dp to account for bigger flat button
May 31, 2018
cdabb2e
Update button.dart
May 31, 2018
d8a89ca
adjust minimum heights of other buttons and fix some tests
Jun 1, 2018
423a093
Merge branch 'a11y_615' of github.com:jonahwilliams/flutter into a11y…
Jun 1, 2018
985fdb6
temporarily turn off two failing tests
Jun 1, 2018
5944354
Merge branch 'master' of github.com:flutter/flutter into a11y_16964
Jun 1, 2018
6e79412
increase minimum touch target to 48x48
Jun 1, 2018
c3fbe84
make outer constraints configurable
Jun 2, 2018
21c2941
increase size of checkbox, switch, and radio button to 48 by 48 to co…
jonahwilliams Jun 10, 2018
d412128
add flag for expanding tap targets
Jun 11, 2018
4bf34be
add smoke test for tap target size
Jun 11, 2018
61c6e30
switch flag for enum
Jun 11, 2018
8a3f125
merge a11y_615 into flag change
Jun 11, 2018
7bb9ff9
merge material button tap target changes adjusted to use new flag
Jun 11, 2018
3bf7bcf
Merge branch 'a11y_16964' into tap_target_flag
Jun 11, 2018
e0b1f28
fix imports and remove public outerConstraints property of chip
Jun 11, 2018
440c962
address comments
Jun 11, 2018
a90b986
fix spelling and add switch statement in time picker
Jun 11, 2018
dbf3dae
fix new wrapping in chip
Jun 11, 2018
1174a2d
Merge remote-tracking branch 'origin/tap_size' into tap_target_flag
Jun 11, 2018
53d3be6
update checkbox, radio, and switch to use additonalConstraints instea…
Jun 11, 2018
0e08fe8
Wrap CheckboxListTile, RadioListTile, and SwitchListTile in a collaps…
Jun 11, 2018
5fb4873
renamed MaterialTapTargetSize enums and add size tests for Checkbox, …
Jun 11, 2018
090b3d2
add size tests to buttons, mini fab, and raw chip
Jun 12, 2018
bb6c3ac
make Checkbox, Radio, and Switch take a MaterialTapTargetSize enum in…
Jun 12, 2018
b26dafb
effects vs affects
Jun 12, 2018
c8d8cf6
Merge branch 'master' of github.com:flutter/flutter into tap_target_flag
jonahwilliams Jun 13, 2018
2e205be
refactor all updated material widgets to take materialTapTargetSize a…
jonahwilliams Jun 13, 2018
a47e806
add redirecting render object
Jun 18, 2018
5f475d8
merge with remote
Jun 18, 2018
7e61552
Address comments
Jun 19, 2018
190be7b
increase chip hit detection and address button comments
Jun 19, 2018
df92deb
Add ink tests for raw material button
jonahwilliams Jun 22, 2018
0145ffb
add tests for material chip behavior
jonahwilliams Jun 22, 2018
fea5961
Merge branch 'master' of https://github.com/flutter/flutter into tap_…
jonahwilliams Jul 3, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add tests for chip semantics
  • Loading branch information
Jonah Williams committed May 25, 2018
commit cf8a1c398fe7ab9989e23f8b94e8f672f30f9377
71 changes: 71 additions & 0 deletions packages/flutter/test/material/chip_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@

import 'dart:ui' show window;

import 'package:flutter/semantics.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';

import '../rendering/mock_canvas.dart';
import '../widgets/semantics_tester.dart';
import 'feedback_tester.dart';

Finder findRenderChipElement() {
Expand Down Expand Up @@ -1145,4 +1147,73 @@ void main() {
expect(materialBox, paints..path(color: customTheme.disabledColor));
expect(labelStyle.style.color, equals(Colors.black.withAlpha(0xde)));
});

testWidgets('Chip semantics', (WidgetTester tester) async {
final SemanticsTester semanticsTester = new SemanticsTester(tester);

await tester.pumpWidget(new MaterialApp(
home: const Material(
child: const Chip(
label: const Text('test'),
),
),
));

expect(semanticsTester, hasSemantics(
new TestSemantics.root(
children: <TestSemantics>[
new TestSemantics(
textDirection: TextDirection.ltr,
children: <TestSemantics>[
new TestSemantics(
flags: <SemanticsFlag>[SemanticsFlag.scopesRoute],
children: <TestSemantics>[
new TestSemantics(
label: 'test',
textDirection: TextDirection.ltr,
),
],
),
],
),
],
), ignoreTransform: true, ignoreId: true, ignoreRect: true));

await tester.pumpWidget(new MaterialApp(
home: new Material(
child: new InputChip(
isEnabled: true,
label: const Text('test'),
onPressed: () {},
),
),
));

expect(semanticsTester, hasSemantics(
new TestSemantics.root(
children: <TestSemantics>[
new TestSemantics(
textDirection: TextDirection.ltr,
children: <TestSemantics>[
new TestSemantics(
flags: <SemanticsFlag>[SemanticsFlag.scopesRoute],
children: <TestSemantics>[
new TestSemantics(
label: 'test',
textDirection: TextDirection.ltr,
flags: <SemanticsFlag>[
SemanticsFlag.hasEnabledState,
SemanticsFlag.isEnabled,
],
actions: <SemanticsAction>[SemanticsAction.tap],
),
],
),
],
),
],
), ignoreTransform: true, ignoreId: true, ignoreRect: true));

semanticsTester.dispose();
});
}