Skip to content

fateme-shm/farsi_date_picker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A persian (farsi, shamsi) date picker for flutter, inspired by alt_persian_date_picker

A Flutter persian date picker inspired by material datetime picker and based on shamsi_date.

You can pick date / range date / Month / Year .

Usage

Add it to your pubspec.yaml file:

dependencies:

farsi_date_picker: version

In your library add the following import:

import 'package:farsi_date_picker/farsi_date_picker.dart';

Here is an example how to use:

            TextButton(
              onPressed: () {
                DatePicker.showDatePicker(
                  context,
                  PickerEnum.month,
                  theme: DatePickerTheme(
                      noneSelectedItemColor: Colors.white,
                      selectedItemColor: Colors.greenAccent,
                      disableItemColor: Colors.redAccent),
                  pickerModel: MonthPickerModel(
                    startSelectedInitDate: 4,
                    disables: [1, 5],
                  ),
                  onConfirm: (time) {
                    print("Selected month is $time");
                    _showToast(time);
                  },
                );
              },
              child: Text("ماه"),
            ),

Date time picker parameters and events

Parameter Type Default Description
type PickerEnum Has 4 values( month , year , date , rangedate )
headerType HeaderType Has 3 values( seprated , mix , writable )
disable String or List<String> null Disable dates
theme DatePickerTheme You can add your style to each part of date picker
onConfirm Function(String) This event return a String date

##Pull request and feedback are always appreciated.

###Contact me with fatemeshm12@gmail.com .

About

farsi date picker for flutter

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages