搜尋套件、儲存庫與 APP 分類

flutter_linear_datepicker 封面
套件詳情v3.0.1

flutter_linear_datepicker

一個提供格里曆與Jalaali(波斯)日期選擇器的Flutter套件

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
248
喜歡數
63
Pub 分數
130

安裝套件

flutter pub add flutter_linear_datepicker

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

一個 Flutter 套件,為格里曆與伊朗歷(波斯曆)日曆提供線性且直覺的日曆選擇介面。設計時著重於簡潔性與可存取性,支援 Android、iOS、Web、macOS、Windows 與 Linux 等多個平台。此選擇器提供順暢的月份與年份導航功能,並支援自訂樣式與地區化選項。非常適合需要雙日曆支援或針對波斯語使用者的應用程式。

適用情境

  • 雙曆法選擇(公曆和傑拉利曆)
  • 表單輸入項目需要選擇日期
  • 面向波斯語受眾的應用程式
  • 跨平台日期選擇器
  • 可自訂的日期選擇器 UI

主要特色

  • 支援格里高利曆與賈拉利曆
  • 線性、易於導航的介面
  • 跨平台相容性
  • 可自訂外觀
  • Localization-ready
  • 透過 pub add 的簡單整合

適合對象

  • 國際申請
  • 伊朗語或波斯語應用程式
  • 需要雙日曆支援的開發者
  • 面向使用者介面的日期輸入元件
  • 需要輕量級日期選擇器的專案

使用建議

  • 限制為兩種日曆系統
  • 無內建時間選擇
  • 需要手動處理日期格式化
  • 可能需要額外的本地化設定
  • 未針對複雜日期範圍進行優化

原始 README

以下為關聯原始碼儲存庫的 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

所屬分類

依賴

依賴清單 1 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。