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

calendar_appbar 封面
插件详情v0.0.6

calendar_appbar

用于自定义 AppBar 的 Flutter 包,带有完整的日历视图和许多新功能!

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
104
喜欢数
241
Pub 分数
140

安装插件

flutter pub add calendar_appbar

插件介绍

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

一个 Flutter 包,提供可自定义的 AppBar,内嵌完整的日历视图。它增强了标准 AppBar 的功能,增加了高级日历功能,使用户能够浏览日期、查看事件,并直接在 App Bar 中与日历数据进行交互。该包专为跨多个平台的无缝集成而设计,支持 Android、iOS、Web、macOS、Windows 和 Linux。适用于需要以日期为中心的导航和紧凑、用户友好的界面中直观访问日历的应用程序。

适合场景

  • 应用栏中的日期选择
  • 事件调度接口
  • 移动应用中的日历导航
  • 时间管理应用
  • 仪表板小部件带日历视图
  • 跨平台日历集成

主要特点

  • Appbar 中的完整日历视图
  • 可自定义的日期选择器
  • 多平台支持
  • 事件高亮
  • 平滑的日期导航
  • 响应式设计

适合对象

  • 开发日历密集型应用的开发者
  • 寻求优雅日期控件的UI设计师
  • 需要紧凑日历界面的应用程序
  • 跨平台 Flutter 项目
  • 生产力和日程安排工具

使用建议

  • 需要仔细的布局规划
  • 大型数据集可能会影响性能
  • 超出基础样式的有限自定义
  • 依赖于平台特定的渲染
  • 不适合复杂的日历工作流
  • 最适合用于以日期为主要交互点的应用程序

原始 README

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

Calendar AppBar

Flutter package for custom AppBar with calendar view.

The package is currently optimized for mobile devices, therefore used only for mobile devices is prefered. It also works for larger screens, although it does not follow the rules of good UI. It is planned to be optimized shortly.

Image Image Image

Features

  • Define your custom color scheme
  • Enable or disable full-screen calendar view
  • Provide a list of dates that will be marked on the calendar view
  • Manipulate with a range of displayed dates
  • Set the language of your choice

Installation and Basic Usage

Add to pubspec.yaml:

dependencies:
  calendar_appbar: ^0.0.6

Then import it to your project:

import 'package:calendar_appbar/calendar_appbar.dart';

Finaly add CalendarAppBar in Scaffold:

@override
Widget build(BuildContext context) {
  return Scaffold(
      appBar: CalendarAppBar(
        onDateChanged: (value) => print(value),
        firstDate: DateTime.now().subtract(Duration(days: 140)),
        lastDate: DateTime.now(),
      ),
    );
}

There are three required attributes of class CalendarAppBar. Attribute onDateChange is a function, which defines what happens when the user selects a date. firstDate attribute defines the first date, which will be available for selection. The date saved in lastDate attribute is the last date available for selection. At first initialization of the object, the date provided as lastDate will be selected, but will not be returned with onDateChange function.

More Custom Usage

Hide Full Screen Calendar View

This package enables the usage of a full-screen calendar view. It is displayed when the user presses on month and year text in the top right corner of the AppBar. It comes in two different versions. If the first and last date are part of the same month the full-screen calendar will be displayed as seen on the third image at the top of this file. In the other way, it will be displayed as seen in the second image. It is possible to disable the full-screen view (which is enabled by default) by adding the following code:

    fullCalendar: false,
Define Your Custom Color Scheme

You can define your custom color scheme by defining white, black and accent color. Those three colors are set to Colors.white, Colors.black87 and Color(0xFF0039D9) by default. It is possible to customize those three colors as shown below.

    white: Colors.white,
    black: Colors.black,
    accent: Colors.blue,

The design is currently optimized for light mode and therefore also suggested to be used in that way to achieve better UX. Dark mode will be added soon.

Custom Padding

The horizontal padding can be customized (default it is set to 25px) by adding the following code:

    padding: 10.0,
Mark Dates with Events

It is possible to provide the list of dates of type List<DateTime>, which will be marked on calendar view with a dot.

    events: List.generate(
            10, (index) => DateTime.now().subtract(Duration(days: index * 2))),

The code above will generate the list of 10 dates for every second day from today backwards.

Back Button

The last attribute of CalendarAppbar is backButton, which is default set to true. Customize that feature by setting this attribute to false.

    backButton: false,
Internationalization

The newest feature the CalendarAppbar package is offering is local support for different languages. Use atribute locale to customize the language used for the plugin by adding the language code as shown below. If this atribute is not set, English language will be used.

    locale: 'en',

Thank you

Special thanks goes to all contributors to this package. Make sure to check them out.

Make sure to check out example project. If you find this package useful, star my GitHub repository.

Getting Started with Flutter

For help getting started with Flutter, view Flutter official documentation online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

所属分类

依赖

依赖清单 1 项

源码仓库

使用此插件的项目

暂无相关数据。