-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Closed
Labels
r: duplicateIssue is closed as a duplicate of an existing issueIssue is closed as a duplicate of an existing issue
Description
i want to add autocomplete in bottomsheet butt its suggestion invisible. so if autocomplete added in bottom sheet suggestion need to show upside to text field.
import 'package:flutter/material.dart';
void main() => runApp(const AutocompleteExampleApp());
class AutocompleteExampleApp extends StatelessWidget {
const
AutocompleteExampleApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Autocomplete Basic'),
),
bottomSheet: AutocompleteBasicExample(),
),
);
}
}
class AutocompleteBasicExample extends StatelessWidget {
const AutocompleteBasicExample({Key? key}) : super(key: key);
static const List<String> _kOptions = <String>[
'aardvark',
'bobcat',
'chameleon',
'aardvark',
'bobcat',
'chameleon',
'aardvark',
'bobcat',
'chameleon',
'aardvark',
'bobcat',
'chameleon',
'aardvark',
'bobcat',
'chameleon',
];
@override
Widget build(BuildContext context) {
return Autocomplete<String>(
optionsBuilder: (TextEditingValue textEditingValue) {
if (textEditingValue.text == '') {
return const Iterable<String>.empty();
}
return _kOptions.where((String option) {
return option.contains(textEditingValue.text.toLowerCase());
});
},
onSelected: (String selection) {
debugPrint('You just selected $selection');
},
);
}
}
Metadata
Metadata
Assignees
Labels
r: duplicateIssue is closed as a duplicate of an existing issueIssue is closed as a duplicate of an existing issue