FLUTTER ECOSYSTEM

IvanHerreraCasas/dynamic_timeline

一个用于创建每日时间线、课程表、甘特图等的部件。

dynamic_timeline 项目封面
Stars
14
Forks
7
最近推送(UTC)
2023年6月18日
项目状态
未归档
Ivan GitHub avatar
GITHUB User

Ivan ↗

Piura, Peru
语言DartC++CMakeHTMLCSwiftKotlinObjective-C

技术话题

此仓库发布的插件

使用的依赖

依赖清单 5 项

原始 README

以下为英文项目原文快照,最新内容请访问 GitHub。

展开 / 收起项目 README

pub package style: very good analysis License: MIT Codecov

A widget to create daily timelines, timetables, gantt charts* and more.

Note: This package is in early stage and has not been tested with large amount of data.

Daily timeline

Daily timeline

Weekly timetable

Weekly timetable styled Weekly timetable

Gantt chart

Gantt chart styled Gantt chart

Features

  • Easy to use API.
  • Rezizable timeline items.
  • Custom label builder.

Usage

Installation

Add the following line to pubspec.yaml:

dependencies:
  dynamic_timeline: ^0.1.2

Basic set up

Make sure to check out the example for more details.

Dynamic timeline requires you to provide firstDateTime, lastDateTime, labelBuilder and a list of items.

  • labelBuilder: Used to build the label of each mark, normally a dateFormat will be used.
  • items: The events of the timeline, who are positioned according to its start and end date times.

Another important property is intervalDuration, that is the lenght of time between each mark.

Example of a daily timeline.

DynamicTimeline(
    firstDateTime: DateTime(1970, 1, 1, 7),
    lastDateTime: DateTime(1970, 1, 1, 22),
    labelBuilder: DateFormat('HH:mm').format,
    intervalDuration: const Duration(hours: 1),
    children: [
      TimelineItem(
        startDateTime: DateTime(1970, 1, 1, 7),
        endDateTime: DateTime(1970, 1, 1, 8),
        child: const Event(title: 'Event 1'),
      ),
      TimelineItem(
        startDateTime: DateTime(1970, 1, 1, 10),
        endDateTime: DateTime(1970, 1, 1, 12),
        child: const Event(title: 'Event 2'),
      ),
      TimelineItem(
        startDateTime: DateTime(1970, 1, 1, 15),
        endDateTime: DateTime(1970, 1, 1, 17),
        child: const Event(title: 'Event 3'),
      ),
    ],
),