搜尋套件、儲存庫與 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 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。