搜索插件、代码仓与 APP 分类

flutter_linear_datepicker 封面
插件详情v3.0.1

flutter_linear_datepicker

一个提供公历和伊朗历(波斯历)日期选择器的 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 项

源码仓库

使用此插件的项目

暂无相关数据。