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

cell_calendar 封面
套件詳情v0.9.0

cell_calendar

現代化日曆組件,具備實用功能。可立即開發出設計精美的日曆。靈感來自 Google 日曆的使用者介面。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
1460
喜歡數
104
Pub 分數
140

安裝套件

flutter pub add cell_calendar

套件介紹

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

一款現代且可自訂的日曆小工具,靈感來自 Google 日曆的使用者介面。它能以最少的設定快速開發出視覺上吸引人的日曆。該套件支援多個平台,並包含直覺的功能,如日期選擇、導航與事件整合。專為尋求簡潔、響應式日曆解決方案,而無需大量自定編碼的開發者設計。適用於需要日期管理且外觀精緻的應用程式。

適用情境

  • 排程應用程式
  • 活動規劃工具
  • 任務管理介面
  • 預訂系統
  • 每日計畫應用
  • 基於日曆的儀表板

主要特色

  • 清爽的、受 Google 日曆啟發的設計
  • 跨平台支援
  • 輕鬆選擇日期
  • 內建導航控制項
  • 可自訂外觀
  • 事件整合功能

適合對象

  • 開發日曆密集型應用的開發者
  • 希望快速實現UI的團隊
  • 需要響應式日曆組件的專案
  • 針對多個作業系統的應用
  • 以設計為重點的行動與Web應用

使用建議

  • 有限的內建事件管理
  • 需要手動處理複雜的排程邏輯
  • 可能需要為獨特主題添加額外的樣式
  • 依賴於Flutter在舊裝置上的渲染效能
  • 不太適合高度專業化的日曆工作流程

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

cell_calendar

pub package License: MIT

Modern calendar widget with useful features. Enables to develop well designed calendar in a moment.

Inspired by the UI of Google Calendar

cell_calendar

Usage

  • Events

You can show the events in the calendar by inserting the list of CalendarEvent as events

    CellCalendar(
      events: [
        CalendarEvent(eventName: "Event 1",eventDate: DateTime1),
        CalendarEvent(eventName: "Event 2",eventDate: DateTime2),
      ]
    );

If you need to customize the calendar more, the additional parameters like eventBackGroundColor, eventTextColor and eventID are helpful.

  • onPageChanged

The callback onPageChanged is literally called when the current page is changed.

    CellCalendar(
      onPageChanged: (firstDate, lastDate) {
        print("This is the first date of the new page: $firstDate");
        print("This is the last date of the new page: $lastDate");
      }
    );

In this sample code, firstDate is the date in the very first cell of the new page, and its logic is same as lastDate.

  • onCellTapped

The callback onCellTapped is called when user tapped a cell.

    CellCalendar(
      onCellTapped: (date) {
        print("$date is tapped !");
      }
    );

It is called with tapped DateTime, so you can get the events on the date if you want.

    CellCalendar(
      onCellTapped: (date){
        print("$date is tapped !");
        final eventsOnTheDate = sampleEvents().where((event) {
          final eventDate = event.eventDate;
          return eventDate.year == date.year &&
              eventDate.month == date.month &&
              eventDate.day == date.day;
        }).toList();
        /// ex) Show dialog or navigate to new page with [eventsOnTheDate]
      }
    );

  • daysOfTheWeekBuilder and monthYearLabelBuilder

If you don't want to use default labels on the calendar, you can use callbacks for customization.

    CellCalendar(
      daysOfTheWeekBuilder: (dayIndex) {
        /// dayIndex: 0 for Sunday, 6 for Saturday.
        final labels = ["S", "M", "T", "W", "T", "F", "S"];
        return Padding(
          padding: const EdgeInsets.only(bottom: 4.0),
          child: Text(
            labels[dayIndex],
            style: TextStyle(
              fontWeight: FontWeight.bold,
            ),
            textAlign: TextAlign.center,
          ),
        );
      },
      monthYearLabelBuilder: (datetime) {
        final year = datetime.year.toString();
        final month = datetime.month.toString();
        return Padding(
          padding: const EdgeInsets.all(16.0),
          child: Text(
            "$month, $year",
            style: TextStyle(
              fontSize: 24,
              fontWeight: FontWeight.bold,
            ),
          ),
        );
      },
    )

If you have any requests or questions, please feel free to ask on github.

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Santa Takahashi
Santa Takahashi

💻
Denis Filonov
Denis Filonov

💻
HPanda
HPanda

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

所屬分類

依賴

依賴清單 1 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。