Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 8 additions & 1 deletion packages/flutter/lib/src/material/autocomplete.dart
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ class Autocomplete<T extends Object> extends StatelessWidget {
displayStringForOption: displayStringForOption,
onSelected: onSelected,
options: options,
openDirection: optionsViewOpenDirection,
maxOptionsHeight: optionsMaxHeight,
);
},
Expand Down Expand Up @@ -166,21 +167,27 @@ class _AutocompleteOptions<T extends Object> extends StatelessWidget {
super.key,
required this.displayStringForOption,
required this.onSelected,
required this.openDirection,
required this.options,
required this.maxOptionsHeight,
});

final AutocompleteOptionToString<T> displayStringForOption;

final AutocompleteOnSelected<T> onSelected;
final OptionsViewOpenDirection openDirection;

final Iterable<T> options;
final double maxOptionsHeight;

@override
Widget build(BuildContext context) {
final AlignmentDirectional optionsAlignment = switch (openDirection) {
OptionsViewOpenDirection.up => AlignmentDirectional.bottomStart,
OptionsViewOpenDirection.down => AlignmentDirectional.topStart,
};
return Align(
alignment: Alignment.topLeft,
alignment: optionsAlignment,
child: Material(
elevation: 4.0,
child: ConstrainedBox(
Expand Down
Loading