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

插件详情v0.0.5

progress_timeline

一个时间轴小部件,可用于显示更大流程中的不同阶段。

近 30 天下载
18
喜欢数
39
Pub 分数
40

安装插件

flutter pub add progress_timeline

插件介绍

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

progress_timeline 包为 Flutter 提供了一个可自定义的时间轴小部件,旨在以视觉方式展示更大流程中的各个阶段。它帮助用户跟踪顺序步骤中的进度,非常适合工作流、引导流程或项目里程碑。该小部件支持线性和垂直布局,并提供自定义指示器、标签和进度标记的选项。它轻量且可无缝集成到现有的 Flutter 应用中。该包是开源的,由社区维护。

适合场景

  • 引导流程
  • 项目里程碑跟踪
  • 订单处理状态
  • 用户旅程可视化
  • 任务完成进度

主要特点

  • 可自定义的时间线布局
  • 视觉进度指示器
  • 对步骤标签的支持
  • 灵活的样式选项
  • 开源且持续维护

适合对象

  • 应用开发者构建引导式工作流程
  • 需要视觉进度跟踪的设计人员
  • 需要逐步用户指导的项目
  • 简单而有效的流程表示用户界面

使用建议

  • 仅限基本的时间线功能
  • 无内置动画支持
  • 未针对非常长的序列进行优化
  • 依赖外部维护以进行更新

原始 README

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

timeline_horizontal

A Flutter Widget to make interactive Progress Timeline.

This widget can be used to make provide an interactive timeline view of a bigger process. Fluid Animations while switching between stages.

Installation

To use this package:

Add the following to your pubspec.yaml file:

dependencies:
    progress_timeline: ^0.0.5
How to Use

Import the library

import 'package:progress_timeline/progress_timeline.dart';

Create a ProgressTimeline object in the state of your Activity

class _MyPageState extends State<MyPage> {
  ProgressTimeline progressTimeline;
.
.
.
}

Create a list of all the stages in your entire process and initialize the progressTimeline variable in initState.

@override
  void initState() {
  List<SingleState> allStages = [
    SingleState(stateTitle: "Stage 1"),
    SingleState(stateTitle: "Stage 2"),
    SingleState(stateTitle: "Stage 3"),
    SingleState(stateTitle: "Stage 4"),
  ];
    screenProgress = new ProgressTimeline(
        states: allStages,
    );
    super.initState();
  }

Add progressTimeline to your build method.

@override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(),
      body: Column(
        children: <Widget>[
           //add the widget
           progressTimeline,
        ],
      ),
    );
  }

Features

Goto Next Stage

call the .gotoNextStage() method to move forward to the next stage in the process.

.
  onPressed: () {
    screenProgress.gotoNextStage();
  },
.
Goto Previous Stage

call the .gotoPreviousStage() method to move back to the last stage in the process.

.
  onPressed: () {
    screenProgress.gotoPreviousStage();
  },
.
Fail Current Stage

call the .failCurrentStage() method to mark the current stage as failed.

.
  onPressed: () {
    screenProgress.failCurrentStage();
  },
.

Customization

You can pass your own Icons, Colors and Sizes for the respective parts of the timeline.

Pass Custom Icons for each type of stage

While initializing the ProgressTimeline widget, pass Icon values for these stages: checked, unchecked, failed, current

@override
  void initState() {
    screenProgress = new ProgressTimeline(
      states: allStages,
      //pass custom icons for each stage.
      checkedIcon: Icon(
        Icons.check_box,
        color: Colors.greenAccent,
      ),
      uncheckedIcon: ..,
      currentIcon: ..,
      failedIcon: ..,
      
    );
    super.initState();
  }
Customize Connector properties

While initializing the ProgressTimeline widget, customize the connector properties to suit your need.

@override
  void initState() {
    screenProgress = new ProgressTimeline(
      states: allStages,
      connectorColor: Colors.blueAccent,
      connectorLength: 120.0,
      connectorWidth: 10.0,
    );
    super.initState();
  }
Customize Icon Size

While initializing the ProgressTimeline widget, customize the Icon Size according to your preference.

@override
  void initState() {
    screenProgress = new ProgressTimeline(
      states: allStages,
      iconSize: 20.0,
      //NOTE: when using bigger icon sizes, modify the height parameter accordingly
      //default value is 100
      height: 200,
    );
    super.initState();
  }
Customize Stage Title TextStyle

While initializing the ProgressTimeline widget, customize the TextStyle of how the stage title is displayed

@override
  void initState() {
    screenProgress = new ProgressTimeline(
      states: allStages,
      textStyle: TextStyle(
        fontSize: 24,
        color: Colors.pink
      ),
    );
    super.initState();
  }

List of all customizable params

Params Type default-value
height double 100
checkedIcon Icon Icon ( Icons.check_circle, color: Colors.green, size:25 );
currentIcon Icon Icon ( Icons.adjust, color: Colors.green, size:25 );
failedIcon Icon Icon ( Icons.highlight_off, color: Colors.redAccent, size:25 );
uncheckedIcon Icon Icon ( Icons.radio_button_unchecked, color: Colors.green, size:25 );
connectorColor Color Colors.green
connectorLength double 40
connectorWidth double 5
iconSize double 25
textStyle TextStyle TextStyle()

所属分类

依赖

依赖清单 1 项

源码仓库

使用此插件的项目

暂无相关数据。