mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Make sure that an Autocomplete doesn't crash in 0x0 environment (#172732)
This is my attempt to handle https://github.com/flutter/flutter/issues/6537 for the Autocomplete UI control. Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
This commit is contained in:
parent
4703b786e6
commit
edc8a52e80
@ -731,6 +731,25 @@ void main() {
|
||||
expect(field2.controller!.text, textSelection);
|
||||
});
|
||||
|
||||
testWidgets('Autocomplete renders at zero area', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: Center(
|
||||
child: SizedBox.shrink(
|
||||
child: Scaffold(
|
||||
body: Autocomplete<String>(
|
||||
initialValue: const TextEditingValue(text: 'X'),
|
||||
optionsBuilder: (TextEditingValue textEditingValue) => <String>['Y'],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
final Finder xText = find.text('X');
|
||||
expect(tester.getSize(xText), Size.zero);
|
||||
});
|
||||
|
||||
testWidgets('autocomplete options have button semantics', (WidgetTester tester) async {
|
||||
const Color highlightColor = Color(0xFF112233);
|
||||
await tester.pumpWidget(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user