drop_down_search_field 1.1.0 drop_down_search_field: ^1.1.0 copied to clipboard
Customizable DropdownSearchField extending features DropdownButton, TextFormField and Autocomplete.
import 'dart:ui';
import 'package:example/example_widgets/multi_select_example.dart';
import 'package:example/example_widgets/paginated_suggestion_example.dart';
import 'package:example/example_widgets/form_field_example.dart';
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Drop down Search Field demo',
scrollBehavior: const MaterialScrollBehavior().copyWith(
dragDevices: {PointerDeviceKind.mouse, PointerDeviceKind.touch}),
home: DefaultTabController(
length: 1,
child: Scaffold(
appBar: AppBar(
title: const Text('Dropdown Search Field Demo'),
),
body: GestureDetector(
onTap: () => FocusScope.of(context).unfocus(),
child: Center(
child: Builder(
builder: (context) => Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
ElevatedButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const FormFieldExample()),
);
},
child: const Text('Form Field Example'),
),
const SizedBox(height: 20),
ElevatedButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
const MultiSelectDropdown()),
);
},
child: const Text('Multi Select Example'),
),
const SizedBox(height: 20),
ElevatedButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
const PaginatedSuggestionExample()),
);
},
child: const Text('Paginated Suggestion Example'),
),
],
),
),
),
),
),
),
);
}
}