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

paged_vertical_calendar 封面
插件详情v1.1.10

paged_vertical_calendar

一个简单的分页框架,用于实现基于日历的界面。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
8660
喜欢数
129
Pub 分数
160

安装插件

flutter pub add paged_vertical_calendar

插件介绍

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

一个 Flutter 包,提供了一个简单、分页的垂直日历框架,用于构建基于日历的界面。它支持跨多个平台的内置分页功能,实现日期间的流畅导航。专为寻求轻量级解决方案以在垂直滚动布局中显示和交互日期范围的开发者设计。该包非常适合用于日程安排应用、计划工具或任何需要直观浏览日期的应用。

适合场景

  • 调度应用程序
  • 每日计划界面
  • 日期选择控件
  • 事件管理仪表板
  • 时间跟踪工具

主要特点

  • 垂直日期分页
  • 跨平台兼容性
  • 简单集成
  • 可自定义日期渲染
  • 内置滚动处理

适合对象

  • 开发日历 UI 的开发者
  • 需要日期导航的应用程序
  • 轻量级日历解决方案
  • Flutter 初学者学习 UI 模式
  • 跨平台日历应用

使用建议

  • 有限的预构建样式选项
  • 需要自定义实现以处理复杂布局
  • 无内置事件管理
  • 未针对横向日历进行优化
  • 高级用例的最小配置

原始 README

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

:calendar: Paged Vertical Calendar :calendar:

Pub Pub Pub

A simple paginated framework for implementing calendar based interfaces.

gif showing of package customizability gif showing dat range picker example gif showing paged data example

:hammer: How it works

paged_vertical_calendar is a very minimalistic framework that automatically loads months based on scoll behavior. It provides many useful callbacks to implement your own calendar interactions and builders to customize the calendar as much as you want. Check the example for several implementations like date range selection and paginated data visualisation.

PagedVerticalCalendar has no required parameters and can be dropped in anywhere providing it has a fixed height.

Scaffold(
  body: PagedVerticalCalendar(),
);

:loudspeaker: functionality

Several callback are provided to facilitate easy implementation of any calendar interactions

PagedVerticalCalendar(
  minDate: DateTime.now().subtract(Duration(days 365)),
  maxDate: DateTime.now().add(Duration(days 365)),
  initialDate: DateTime.now().add(Duration(days 3)),
  invisibleMonthsThreshold: 1,
  startWeekWithSunday: true,
  onMonthLoaded: (year, month) {
    // on month widget load 
  },
  onDayPressed: (value) {
    // on day widget pressed   
  },
  onPaginationCompleted: (direction) {
    // on pagination completion
  },
);
  • onMonthLoaded is a callback that fires for every month added to the list. When this function fires can be altered by setting the invisibleMonthsThreshold pararamter.

  • invisibleMonthsThreshold decides how many months outside of the widgets view should be loaded. In other words, how many months should be preloaded before the user reaches that scroll position. It defaults to 1.

  • onDayPressed Is a simple onPressed callback but also provides the DateTime of the day that has been pressed.

  • If your app is localized for countries where the week starts on Sunday, you can flip startWeekWithSundayto true.

  • If a minDate is provided the calendar will stop scrolling up at that date. make sure minDate < maxDate.

  • If a maxDate is provided the calendar will stop scrolling down at that date. make sure maxDate > minDate.

  • If an initialDate is provided the calendar start by displaying this date (otherwise DateTime.now()). make sure minDate < initialData < maxDate.

  • Finally when a minDate or maxDate is provided to the PagedVerticalCalendar, the onPaginationCompleted callback can be used. it will return a PaginationDirection to indicate what side of the calendar has been reached.

  • and many many more, see the docs!!!

:art: Customization

PagedVerticalCalendar provides default calendar styling, but these can be fully customized. To do so, several builders are provided:

PagedVerticalCalendar(
  monthBuilder: (context, month, year) {
    // provide a month header widget
  },
  dayBuilder: (context, date) {
    // provide a day widget
  },
  listPadding: // provide EdgeInset value
);
  • monthBuilder provides the year and month as integers. this builder has to return a widget that will form the header of ever month. the intl package works well here for date formatting.

  • dayBuilder provides the day as a DateTime. this builder wil be called for every day. You usually want to provide at least a text widget with the current day number.

  • listPadding can be provided in case you need the list to have padding.

:wave: Get Involved

If this package is useful to you please :thumbsup: on pub.dev and :star: on github. If you have any Issues, recommendations or pull requests I'd love to see them!

所属分类

依赖

依赖清单 1 项

源码仓库

使用此插件的项目