搜尋套件、儲存庫與 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 項

原始碼儲存庫

使用此套件的專案