flutter_persian_date_picker 0.0.1 copy "flutter_persian_date_picker: ^0.0.1" to clipboard
flutter_persian_date_picker: ^0.0.1 copied to clipboard

DatePicker with full support of the Persian calendar with highly customizable and responsive UI.

πŸ“… Flutter Persian Date Picker #

Provides full support of the Persian calendar with highly customizable and responsive UI. The performance is quick enough to run smoothly on variety of devices including low-end phones.


πŸ“— Step by step guide: #

1- Install with one of these ways:

dependencies:
  flutter_persian_date_picker: ^0.0.1

or

$ flutter pub add flutter_persian_date_picker

2- Import to your Dart code:

import 'package:flutter_persian_date_picker/date_picker.dart';
import 'package:shamsi_date/shamsi_date.dart';

3- Simply use PersianDatePicker as any widget child:

PersianDatePicker(
  onSubmitDate: (selectedDate) {
    
  },
  onEmptyDateSubmit: () {
    
  },
),

4- Assign 2 required variables by following the document bellow.

✏️ Quick Document: #

/// This gets called when user selects a date and taps the Submit button.
/// use selectedDate.formatter to access all details of the user's selected date
///
/// It is recommended to call [pop] if you are using [PersianDatePicker] inside a BottomSheet / Dialog
final void Function(Jalali selectedDate) onSubmitDate;

/// This gets called when user has no selected date and taps the Submit button.
///
/// It is recommended to show a toast as a hint for the user
final void Function() onEmptyDateSubmit;

/// Simply pass a date if you wish to have a date to be selected initially. This is pretty useful
/// for situations where user has saved a date in your state management
final Jalali? chosenDate;

/// Leave this empty if you want your [PersianDatePicker] to contain the whole width of the screen
///
/// If there is a [Padding] widget as parent of this widget and you want it to have a desired width too,
/// simply make a sum of width and the padding. For example:
/// int desiredWidth = 400;
/// int horizontalPadding = 10;
/// widthWithPadding = desiredWidth + (horizontalPadding * 2)
///
/// If you only want a desired width and there are no [Padding] as it's parent, just pass the width
///
/// If there is [Padding] as it's parent and you want it to take the whole width,
/// make a sum of your padding and MediaQuery.of(context).size.width
final double? widthWithPadding;

/// TextStyle for week titles.
final TextStyle weekTitlesTextStyle;

/// TextStyle for header navigator buttons
final TextStyle headerButtonsTextStyle;

/// ButtonStyle for header navigator buttons
final ButtonStyle headerButtonsStyle;

/// TextStyle for month display text on top (bold text is recommended)
final TextStyle headerMonthDisplayTextStyle;

/// The Color for days background
final Color dateBackgroundColor;

/// TextStyle for day numbers
final TextStyle dateTextStyle;

/// The visibility type and color for selected date
final SelectedDateStyle selectedDateStyle;

/// ButtonStyle for the button in the bottom
final ButtonStyle submitButtonStyle;

πŸ“¦ Used Packages:

FatulM/shamsi_date

5
likes
0
points
36
downloads

Publisher

unverified uploader

Weekly Downloads

DatePicker with full support of the Persian calendar with highly customizable and responsive UI.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, flutter_web_plugins, plugin_platform_interface, shamsi_date

More

Packages that depend on flutter_persian_date_picker