FLUTTER ECOSYSTEM

alikhaleghi76/flutter-datepicker

Flutter 格里高利與賈拉利(波斯)日期選擇器

flutter-datepicker 專案封面
Stars
40
Forks
20
最近推送(UTC)
2025年3月15日
專案狀態
未封存
Ali Khaleghi GitHub avatar
GITHUB User

Ali Khaleghi ↗

Android and Flutter developer

Tehran
語言DartC++CMakeSwiftCHTMLKotlinObjective-C

此儲存庫發佈的套件

使用的依賴

依賴清單 3 項
  • flutter{"sdk":"flutter"}
  • shamsi_date^1.0.4
  • flutter_test開發依賴{"sdk":"flutter"}

原始 README

以下為英文專案原文快照,最新內容請造訪 GitHub。

展開 / 收合專案 README

Flutter Persian (Jalali) and Gregorian Linear Date Picker

Pub

This package provides a Persian or Gregorian linear DatePicker for flutter.

Screenshot 1 Screenshot 2


Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

dependencies:
 flutter_linear_datepicker: ^3.0.1
2. Install it

You can install packages from the command line:

$ 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';

How to use?

Simple usage

just simply put following widget in your flutter code:

LinearDatePicker(
  dateChangeListener: (DateTime selectedDate) {
    print(selectedDate);
  },
);

Advanced usage

You can customize widget using below parameters:

LinearDatePicker(
  startDate: DateTime(2022),
  endDate: DateTime.now().add(Duration(days: 365)),
  initialDate: DateTime.now(),
  dateChangeListener: (DateTime selectedDate) {
    print(selectedDate);
  },
  showDay: true,  //false -> only select year & month
  labelStyle: TextStyle(
    fontFamily: 'sans',
    fontSize: 14.0,
    color: Colors.black,
  ),
  selectedRowStyle: TextStyle(
    fontFamily: 'sans',
    fontSize: 18.0,
    color: Colors.deepOrange,
  ),
  unselectedRowStyle: TextStyle(
    fontFamily: 'sans',
    fontSize: 16.0,
    color: Colors.blueGrey,
  ),
  yearLabel: 'سال | year',
  monthLabel: 'ماه | month',
  dayLabel: 'روز | day',
  showLabels: true, // to show column captions, eg. year, month, etc.
  columnWidth: 100,
  showMonthName: true,
  isJalali: false,  // false -> Gregorian
  debounceDuration: Duration(milliseconds: 300), // delay duration to emit the selected date
  monthsNames: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12',] // custom name for each month
)

Used Packages

MarcinusX/NumberPicker FatulM/shamsi_date