Dropdown Calendar
A Flutter package that provides a selectable dropdown calendar for picking a date. This widget allows users to easily select a date from a dropdown-style calendar while offering customizable designs to fit your app's theme.
Features
- 📅 Dropdown Date Picker – Users can select a date from a dropdown-style calendar.
- 🎨 Fully Customizable – Change colors, styles, and UI to match your app's theme.
- 🔄 Easy Integration – Simple to add and use with just a few lines of code.
- 📅 Dropdown Date Picker – Users can select a date from a dropdown-style calendar.
- 🎨 Fully Customizable – Change colors, styles, and UI to match your app's theme.
- 🔄 Easy Integration – Simple to add and use with just a few lines of code.
- 🚀 Supports Different Date Formats – Display the date in various formats as per your needs.
- ✅ Validation Support – Ensure a date is selected before proceeding, preventing empty submissions.
- 🔔 Error Handling – Show error messages if an invalid or no date is selected.
- 📆 Min & Max Date Selection – Restrict users from selecting past or future dates beyond a set range.
- 🔄 Live Updates – Automatically update the UI when the selected date changes.
Getting Started
To use this package, add the following to your pubspec.yaml:
dependencies:
dropdown_calender: 1.0.1
flutter pub get
USAGE
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key});
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
TextEditingController controller= TextEditingController();
final _form=GlobalKey<FormState>();
@override
Widget build(BuildContext context) {
return Scaffold(
body: Form(
key: _form,
child: Column(
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: DropdownCalender(
controller:controller,
validator:(value){
if(value ==null || value.isEmpty){
return "Select Date";
}
return null;
},
startDate:DateTime(1930) ,
endDate:DateTime(2030,9,1) ,
dateSelectorConfig: DateSelectorConfig(
prefixIcon:Icon(Icons.today_outlined),
isDense: true,
border: OutlineInputBorder()
),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: ElevatedButton(onPressed: (){
if(_form.currentState!.validate()){
log("Validation work");
}else{
log("Validation is not work");
}
}, child: Text("Click")),
)
],
),
),
);
}
}