Fix bug in Autocomplete example (#127219)
This example was incorrectly throwing away results from a query when multiple queries were pending at once. Thanks to @sun-jiao in https://github.com/flutter/flutter/pull/127019#issuecomment-1552347037 for pointing this out.
I also added a quick `Text` widget explaining what to do to use the examples. Since there are only three small possible `options`, it's easy to type into the field and not get any results and wonder what's wrong.
diff --git a/examples/api/lib/material/autocomplete/autocomplete.1.dart b/examples/api/lib/material/autocomplete/autocomplete.1.dart
index 7e3798e..abee231 100644
--- a/examples/api/lib/material/autocomplete/autocomplete.1.dart
+++ b/examples/api/lib/material/autocomplete/autocomplete.1.dart
@@ -18,8 +18,14 @@
appBar: AppBar(
title: const Text('Autocomplete Basic User'),
),
- body: const Center(
- child: AutocompleteBasicUserExample(),
+ body: Center(
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: <Widget>[
+ Text('Type below to autocomplete the following possible results: ${AutocompleteBasicUserExample._userOptions}.'),
+ const AutocompleteBasicUserExample(),
+ ],
+ ),
),
),
);