File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11## 0.8.2
22- Support for Flutter 3.38
33- Added ` Color ` methods, ` SafeArea ` widget, and ` showBottomSheet ` function.
4+ - Added ` MaterialButton ` , ` Autocomplete ` , and related classes.
45- Exported multiple wrappers (thanks @Zverik )
56- Fix typo in example code (thanks @chan150 )
67
Original file line number Diff line number Diff line change @@ -357,8 +357,8 @@ class $Autocomplete implements $Instance {
357357 final future = (args[1 ]! as EvalCallable )(runtime, null , [
358358 $TextEditingValue .wrap (textEditingValue),
359359 ]);
360- final value = await ( future as Future < dynamic >) ;
361- return value;
360+ final value = await future! .$value ;
361+ return ( value? .$value as Iterable < dynamic >). cast () ;
362362 },
363363 displayStringForOption: args[2 ] == null
364364 ? RawAutocomplete .defaultStringForOption
Original file line number Diff line number Diff line change @@ -448,7 +448,7 @@ void main() {
448448 'main.dart' : '''
449449 import 'package:flutter/material.dart';
450450 class MyWidget extends StatelessWidget {
451- final _options = [
451+ final List<Option> _options = [
452452 Option(1, 'Alice'),
453453 Option(2, 'Bob'),
454454 Option(3, 'Charlie'),
@@ -458,10 +458,6 @@ void main() {
458458
459459 MyWidget(this.onSelect, {super.key});
460460
461- Iterable<Option> filterByString(String text) {
462- return List.of(_options.where((o) => o.title.toLowerCase().contains(text)));
463- }
464-
465461 @override
466462 Widget build(BuildContext context) {
467463 return MaterialApp(home: Scaffold(
@@ -472,16 +468,7 @@ void main() {
472468 child: Text('Click me'),
473469 optionsBuilder: (value) async {
474470 final text = value.text.toLowerCase();
475- // return _options; works; nothing of this ↓ does
476- return _options.where((o) => o.title.toLowerCase().contains(text));
477- print(1);
478- return filterByString(text);
479- print(2);
480- final opt = _options.where((o) => true);
481- print(3);
482- final opt2 = _options.where((o) => o.title.toLowerCase().contains(text));
483- print(4);
484- return _options; // .where((o) => o.title.toLowerCase().contains(text));
471+ return _options.where((Option o) => o.title.toLowerCase().contains(text));
485472 },
486473 displayStringForOption: (o) => o.title,
487474 onSelected: (value) {
You can’t perform that action at this time.
0 commit comments