Skip to content

Commit a1ad0e5

Browse files
webstoreportalslimlime
authored andcommitted
doc(types,product_autocomplete): add type aliases doco
Dart more flexible typedefs may be coming soon in Dart 2.13 dart-lang/language#65
1 parent 4c9bfec commit a1ad0e5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

lib/webstore/catalogue/product/autocomplete/types/product_autocomplete_types.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,29 @@ import 'package:flutter/material.dart'
33
import 'package:testable_web_app/webstore/catalogue/product/models/product_model.dart'
44
show ProductModel;
55

6+
/// Circumspect typedef.
7+
/// Dart does not support simple type aliases typedef on typedef
8+
/// https://github.com/dart-lang/language/issues/65
9+
///
10+
/// final AutocompleteOptionsBuilder<ProductModel> optionsBuilder;
11+
///
612
typedef ProductAutocompleteOptionsBuilder = Iterable<ProductModel> Function(
713
TextEditingValue textEditingValue,
814
);
15+
16+
/// final AutocompleteOptionsViewBuilder<ProductModel> optionsViewBuilder;
917
typedef ProductAutocompleteOptionsViewBuilder = Widget Function(
1018
BuildContext context,
1119
AutocompleteOnSelected<ProductModel> onSelected,
1220
Iterable<ProductModel> options,
1321
);
22+
23+
/// final AutocompleteOnSelected<ProductModel>? onSelected;
1424
typedef ProductAutocompleteOnSelected = void Function(
1525
ProductModel option,
1626
);
27+
28+
/// final AutocompleteOptionToString<ProductModel>? displayStringForOption;
1729
typedef ProductAutocompleteOptionToString = String Function(
1830
ProductModel option,
1931
);

0 commit comments

Comments
 (0)