flutter_linear_datepicker 1.0.9 flutter_linear_datepicker: ^1.0.9 copied to clipboard
A flutter package providing Gregorian and Jalaali (Persian) date picker
Flutter Linear Date Picker #
Flutter Gregorian and Jalaali (Persian) linear date picker #
Use this package as a library #
1. Depend on it
Add this to your package's pubspec.yaml file:
dependencies:
flutter_linear_datepicker: ^1.0.9
2. Install it
You can install packages from the command line:
with pub:
$ pub get
with Flutter:
$ flutter pub get
Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.
3. Import it
Now in your Dart code, you can use:
import 'package:flutter_linear_datepicker/flutter_datepicker.dart';
import 'package:flutter_linear_datepicker/number_picker.dart';
How to use? #
simple usage
just simply infalate following snippet in your flutter code:
LinearDatePicker();
advanced usage
You can customize widget using below parameters:
LinearDatePicker(
startDate: "2004/10/17", //yyyy/mm/dd
endDate: "2020/02/20",
initialDate: "2010/11/15",
dateChangeListener: (String selectedDate) {
print(selectedDate);
},
showDay: true, //false -> only select year & month
fontFamily: 'sans',
showLabels: true, // to show column captions, eg. year, month, etc.
textColor: Colors.black,
selectedColor: Colors.deepOrange,
unselectedColor: Colors.blueGrey,
yearText: "سال | year",
monthText: "ماه | month",
dayText: "روز | day",
columnWidth: 100,
isJalaali: false // false -> Gregorian
),