패키지, 저장소 및 앱 카테고리 검색

timelines 표지
패키지 상세v0.1.0

timelines

Flutter용 강력하고 사용하기 쉬운 타임라인 패키지입니다. 이 패키지의 모든 UI 컴포넌트는 별도의 위젯입니다.

30일 다운로드
8.3천
좋아요
1.8천
Pub 점수
70

패키지 설치

flutter pub add timelines

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

timelines 패키지는 사용자 친화적이고 유연한 Flutter 라이브러리로, 사용자 정의 가능한 타임라인 UI를 만들 수 있도록 설계되었습니다. 모듈식이고 독립적인 위젯을 제공하여 개발자가 복잡한 타임라인을 쉽게 구축할 수 있게 해줍니다. 타임라인 항목, 연결선, 표시기와 같은 각 구성 요소는 별도의 위젯으로 구현되어 레이아웃과 스타일링에 대해 세밀한 제어가 가능합니다. 프로젝트 진행 상황, 이벤트 역사, 프로세스 흐름과 같은 시계열 데이터를 표시하는 데 적합하며, 수직 및 수평 방향 모두를 지원합니다. 간결성과 확장성을 중시하여 깔끔하고 인터랙티브한 타임라인이 필요한 앱에 적합합니다.

사용 사례

  • 프로젝트 마일스톤 표시
  • 앱에서 이벤트 기록 보기
  • 단계별 프로세스 시각화
  • 온보딩 시퀀스 생성
  • 역사적 데이터 표시
  • 작업 추적 인터페이스 구축

주요 기능

  • 모듈식 위젯 컴포넌트
  • 수직 및 수평 레이아웃 지원
  • 사용자 정의 가능한 커넥터 및 표시기
  • 기존 Flutter 앱과의 간편한 통합
  • 사용자 정의 스타일링을 위한 확장 가능한 디자인
  • 경량화되고 집중된 기능

적합한 대상

  • 시계열 기반 UI를 구축하는 개발자
  • 시각적 진행 추적을 필요로 하는 앱
  • 교육 또는 생산성 애플리케이션
  • 온보딩 또는 튜토리얼 흐름
  • 재사용 가능한 타임라인 요소를 원하는 디자이너

고려 사항

  • 제한된 내장 애니메이션
  • 자동 항목 정렬 처리 없음
  • 수동 레이아웃 관리가 필요합니다
  • 매우 긴 타임라인에 최적화되지 않음
  • 항목에 대한 터치 제스처 지원 없음
  • 정적 또는 단순한 동적 타임라인에 가장 적합

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

banner

Pub Awesome Flutter License: MIT

A powerful & easy to use timeline package for Flutter! 🚀

Caveat: This package is an early stage. Not enough testing has been done to guarantee stability. Some APIs may change.

Examples

Check it out on the web or look at the source code.

Timeline status Package delivery tracking Process timeline
timeline_status package_delivery_tracking.gif process_timeline.gif

More examples
🚧 WIP 🚧

Features

The timeline and each components are all WIDGET.
  • Common styles can be easily implemented with predefined components.
  • Vertical, horizontal direction.
  • Alternating contents.
  • Combination with Flutter widgets(Row, Column, CustomScrollView, etc).
  • Customize each range with themes.

Getting started

Installation

1. Depend on it

Add this to your package's pubspec.yaml file:

dependencies:
  timelines: ^[latest_version]
2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:timelines/timelines.dart';

Basic Usage

@override
Widget build(BuildContext context) {
  return Timeline.tileBuilder(
    builder: TimelineTileBuilder.fromStyle(
      contentsAlign: ContentsAlign.alternating,
      contentsBuilder: (context, index) => Padding(
        padding: const EdgeInsets.all(24.0),
        child: Text('Timeline Event $index'),
      ),
      itemCount: 10,
    ),
  );
}

Check the Example or the API reference for more details.

Components

Theme

Check out Theme Demo to see how the values inside TimelineTile work with the theme.

To customize the timeline component with a theme, do the following:

TimelineTheme(
  data: TimelineThemeData(...),
  child: DotIndicator(...),
);

If you only want to change part of the parent theme, use TimelineTheme.of(context):

TimelineTheme(
  data: TimelineThemeData.of(context).copyWith(...),
  child: DotIndicator(...),
);

If the component you want to customize is Timeline or FixedTimeline, this is also possible:

FixedTimeline(
  theme: TimelineThemeData(...),
  children: [...],
);
Indicator
ContainerIndicator
ContainerIndicator
ContainerIndicator(
  child: Container(
    width: 15.0,
    height: 15.0,
    color: Colors.blue,
  ),
)
DotIndicator
DotIndicator
DotIndicator()
OutlinedDotIndicator
OutlinedDotIndicator
OutlinedDotIndicator()
Connector
SolidLineConnector
SolidLineConnector
SizedBox(
  height: 20.0,
  child: SolidLineConnector(),
)
DashedLineConnector
DashedLineConnector
SizedBox(
  height: 20.0,
  child: DashedLineConnector(),
)
DecoratedLineConnector
DecoratedLineConnector
SizedBox(
  height: 20.0,
  child: DecoratedLineConnector(
    decoration: BoxDecoration(
      gradient: LinearGradient(
        begin: Alignment.topCenter,
        end: Alignment.bottomCenter,
        colors: [Colors.blue, Colors.lightBlueAccent[100]],
      ),
    ),
  ),
)
TimelineNode

Pure timeline UI component with no content.

The TimelineNode contains an indicator and two connectors on both sides of the indicator:

Simple TimelineNode
Simple TimelineNode
SizedBox(
  height: 50.0,
  child: TimelineNode.simple(),
)
Complex TimelineNode
Complex TimelineNode
SizedBox(
  height: 80.0,
  child: TimelineNode(
    indicator: Card(
      margin: EdgeInsets.zero,
      child: Padding(
        padding: EdgeInsets.all(8.0),
        child: Text('Complex'),
      ),
    ),
    startConnector: DashedLineConnector(),
    endConnector: SolidLineConnector(),
  ),
)
TimelineTile

Displays content on both sides of the node:

TimelineTile
TimelineTile
TimelineTile(
  oppositeContents: Padding(
    padding: const EdgeInsets.all(8.0),
    child: Text('opposite\ncontents'),
  ),
  contents: Card(
    child: Container(
      padding: EdgeInsets.all(8.0),
      child: Text('contents'),
    ),
  ),
  node: TimelineNode(
    indicator: DotIndicator(),
    startConnector: SolidLineConnector(),
    endConnector: SolidLineConnector(),
  ),
)
TimelineTileBuilder

TimelineTileBuilder provides powerful build features.

Connection

Each tile draws only half of the line connecting the neighboring tiles. Using the connected constructor, lines connecting adjacent tiles can build as one index.

ConnectionDirection.before
Connection direction before
FixedTimeline.tileBuilder(
  builder: TimelineTileBuilder.connectedFromStyle(
    connectionDirection: ConnectionDirection.before,
    connectorStyleBuilder: (context, index) {
      return (index == 1) ? ConnectorStyle.dashedLine : ConnectorStyle.solidLine;
    },
    indicatorStyleBuilder: (context, index) => IndicatorStyle.dot,
    itemExtent: 40.0,
    itemCount: 3,
  ),
)
ConnectionDirection.after
Connection direction after
FixedTimeline.tileBuilder(
  builder: TimelineTileBuilder.connectedFromStyle(
    connectionDirection: ConnectionDirection.after,
    connectorStyleBuilder: (context, index) {
      return (index == 1) ? ConnectorStyle.dashedLine : ConnectorStyle.solidLine;
    },
    indicatorStyleBuilder: (context, index) => IndicatorStyle.dot,
    itemExtent: 40.0,
    itemCount: 3,
  ),
)
ContentsAlign

This value determines how the contents of the timeline will be built:

ContentsAlign.basic
Basic contents align
FixedTimeline.tileBuilder(
  builder: TimelineTileBuilder.connectedFromStyle(
    contentsAlign: ContentsAlign.basic,
    oppositeContentsBuilder: (context, index) => Padding(
      padding: const EdgeInsets.all(8.0),
      child: Text('opposite\ncontents'),
    ),
    contentsBuilder: (context, index) => Card(
      child: Padding(
        padding: const EdgeInsets.all(8.0),
        child: Text('Contents'),
      ),
    ),
    connectorStyleBuilder: (context, index) => ConnectorStyle.solidLine,
    indicatorStyleBuilder: (context, index) => IndicatorStyle.dot,
    itemCount: 3,
  ),
)
ContentsAlign.reverse
Reverse contents align
FixedTimeline.tileBuilder(
  builder: TimelineTileBuilder.connectedFromStyle(
    contentsAlign: ContentsAlign.reverse,
    oppositeContentsBuilder: (context, index) => Padding(
      padding: const EdgeInsets.all(8.0),
      child: Text('opposite\ncontents'),
    ),
    contentsBuilder: (context, index) => Card(
      child: Padding(
        padding: const EdgeInsets.all(8.0),
        child: Text('Contents'),
      ),
    ),
    connectorStyleBuilder: (context, index) => ConnectorStyle.solidLine,
    indicatorStyleBuilder: (context, index) => IndicatorStyle.dot,
    itemCount: 3,
  ),
)
ContentsAlign.alternating
Alternating contents align
FixedTimeline.tileBuilder(
  builder: TimelineTileBuilder.connectedFromStyle(
    contentsAlign: ContentsAlign.alternating,
    oppositeContentsBuilder: (context, index) => Padding(
      padding: const EdgeInsets.all(8.0),
      child: Text('opposite\ncontents'),
    ),
    contentsBuilder: (context, index) => Card(
      child: Padding(
        padding: const EdgeInsets.all(8.0),
        child: Text('Contents'),
      ),
    ),
    connectorStyleBuilder: (context, index) => ConnectorStyle.solidLine,
    indicatorStyleBuilder: (context, index) => IndicatorStyle.dot,
    itemCount: 3,
  ),
)
Timeline

The timeline component has two widgets, Timeline similar to ScrollView and FixedTimeline similar to Flex.

Also their constructors are similar to ScrollView and Flex.

The main difference is that they has TimelineTheme as an ancestor.

The tileBuilder constructor provides more powerful features using TimelineTileBuilder.

If you don't need TimelineTileBuilder, you can use other flutter widgets like ListView, Column, Row, etc.

Even if you use the flutter widget, you can use TimelineTheme.

Documentation

See full documentation

Changelog

See CHANGELOG.md.

Code of conduct

See CODE_OF_CONDUCT.md.

License

MIT

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트