dynamic_searchable_drop_down 0.0.1 dynamic_searchable_drop_down: ^0.0.1 copied to clipboard
Yet another searchable dropdown.
import 'package:dynamic_searchable_drop_down/dynamic_searchable_drop_down.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
themeMode: ThemeMode.dark,
darkTheme: ThemeData(brightness: Brightness.light),
debugShowCheckedModeBanner: false,
title: 'DropDown Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: const MyHomePage(),
);
}
}
class MyHomePage extends StatelessWidget {
const MyHomePage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Searchable Drop Down'),
),
body: SafeArea(
child: Padding(
padding: const EdgeInsets.all(10),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
const SizedBox(
height: 50,
),
SearchableDropdown(
disabledColor: Colors.blue,
hint: '-Select-',
outlineColor: Colors.black,
dropDownList: const [
'India',
'America',
'United Kingdom',
'Norway'
],
onSelected: (val) {
debugPrint('value is $val');
},
),
const SizedBox(
height: 50,
),
],
),
),
),
);
}
}