picker_date 0.0.1
picker_date: ^0.0.1 copied to clipboard
picker date is a flutter library that allows you to select date
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:picker_date/picker_date.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: const DemoPage(),
);
}
}
class DemoPage extends StatelessWidget {
const DemoPage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Favorite Button usage demo'),
),
body: SizedBox(
width: MediaQuery.of(context).size.width,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
///Date picker
PickerDate(
onSubmit: (List<DateTime>? selectedDate) {
Navigator.pop(context);
if(selectedDate!=null){
if(selectedDate.isNotEmpty){
}
}
},
),
],
)),
);
}
}