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

simple_month_year_picker 封面
插件详情v1.1.0

simple_month_year_picker

简单易用的月/年选择器,适用于您的应用,具有高度可定制选项。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
300
喜欢数
7
Pub 分数
160

安装插件

flutter pub add simple_month_year_picker

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

一个简单且高度可定制的月/年选择器,适用于Flutter应用。设计用于轻松集成,允许用户以最少的设置选择特定的月份和年份。该包支持多个平台,包括Android、iOS、Web、macOS、Windows和Linux,非常适合跨平台应用。通过灵活的样式和配置选项,开发者可以将选择器的外观和行为调整为符合其应用的设计。它轻量级,专注于日期选择,没有不必要的复杂性。

适合场景

  • 在表单中选择出生日期
  • 按月和年过滤数据
  • 设置预约日期
  • 配置报表时间范围
  • 构建基于日历的功能

主要特点

  • 高度可定制的用户界面
  • 跨平台兼容性
  • 简单的 API 集成
  • 支持所有主要平台
  • 轻量且快速
  • 可配置的日期范围

适合对象

  • 开发日期选择界面的开发者
  • 需要月份/年份输入的应用程序
  • 需要轻量级日期选择器的项目
  • 跨平台 Flutter 应用
  • 以用户界面为重点的应用程序

使用建议

  • 仅限月份/年份选择
  • 无按天粒度
  • 需要手动处理日期逻辑
  • 不适用于完整日历视图
  • 可能需要对边缘情况额外验证

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

Simple Month Year Picker

Simple to use month/year picker for your apps with highly customisable options.

screenshot1

Getting started

Add this to your package's pubspec.yaml file

dependencies:
  simple_month_year_picker: ^1.1.0

Usage

Next, you just have to import the package using:

import 'package:simple_month_year_picker/simple_month_year_picker.dart';
  Widget build(BuildContext context) {
   return ElevatedButton(
              onPressed: () async {
                // This is in order to get the selected date.
                final selectedDate =
                    await SimpleMonthYearPicker.showMonthYearPickerDialog(
                        context: context,
                        titleTextStyle: TextStyle(),
                        monthTextStyle: TextStyle(),
                        yearTextStyle: TextStyle(),
                        disableFuture:
                            true // This will disable future years. it is false by default.
                        );
                // Use the selected date as needed
                print('Selected date: $selectedDate');
              },
              child: const Text('show dialog'),
            );
  }

Additional information

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

所属分类

源码仓库

使用此插件的项目

暂无相关数据。