搜尋套件、儲存庫與 APP 分類

square_progress_indicator 封面
套件詳情v0.0.8

square_progress_indicator

您可以建立可自訂的方形進度指示器,類似於原生 Flutter 的 CircularProgressIndicator 小部件。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
5280
喜歡數
30
Pub 分數
160

安裝套件

flutter pub add square_progress_indicator

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

一個可自訂的方型進度指示器元件,靈感來自原生的 CircularProgressIndicator。它提供了一種現代、緊湊的圓形進度指示器替代方案,支援自訂顏色、線條寬度與動畫。非常適合在 UI 設計中更適合方型布局的應用程式載入狀態中使用。此套件輕量且相容於所有主要平台,包含 Android、iOS、Web、macOS、Windows 與 Linux。

適用情境

  • 表單中的加載指示器
  • 在儀表板中顯示進度
  • 移動應用中的自定義加載動畫
  • 用方形進度條替換圓形進度條
  • 增強材質設計應用中的UI一致性

主要特色

  • 方形設計
  • 可自訂的顏色和筆畫寬度
  • 平滑動畫
  • 跨平台相容性
  • 與 Flutter 的簡單整合
  • 可擴展的樣式選項

適合對象

  • 尋求替代進度指示器的開發者
  • 專注於方塊主題介面的UI設計師
  • 需要一致加載視覺效果的應用程式
  • Flutter 項目針對多個平台
  • 使用現代美學的 Material Design 項目

使用建議

  • 限制為方形幾何
  • 可能需要額外的樣式來實現複雜的動畫
  • 不適用於圓形進度需求
  • 依賴於 Flutter 的渲染效能
  • 最適合在方形形狀與設計語言一致的上下文中使用

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

Create fully customizable square or rectangle progress indicators like native flutter CircularProgressIndicator widget!

Features

Full example of SquareProgressIndicator

Live demo

You can check the example project web export on this link: https://amir14a.github.io/square_progress_indicator/ Thanks to Github!❤️

Usage

Simple usage:

const SquareProgressIndicator(),

Customize usage:

SquareProgressIndicator(
    value: _value,
    width: 100,
    height: 100,
    borderRadius: 0,
    startPosition: StartPosition.leftCenter,
    strokeCap: StrokeCap.square,
    clockwise: true,
    color: Colors.purple,
    emptyStrokeColor: Colors.purple.withOpacity(.5),
    strokeWidth: 16,
    emptyStrokeWidth: 16,
    strokeAlign: SquareStrokeAlign.center,
    child: Text("${(_value * 100).toStringAsFixed(0)}%"),
),

Additional information

Parameter Type Default Info
value double? null The value of the progress, it should be between 0 and 1. don't pass it to use Indeterminate mode
width double 38 The width of rectangle that the progress line is drawn around it.
height double 38 The height of rectangle that the progress line is drawn around it.
borderRadius double 8 The border radius of the rectangle, it is applied to all four corners.
color Color? progressIndicatorTheme.color The color of the progress line.
emptyStrokeColor Color? progressIndicatorTheme.circularTrackColor The color of the line behind the progress line which show for reminding progress.
strokeWidth double 4 The width of the progress line.
emptyStrokeWidth double 4 The width of the line behind the progress line which show for reminding progress.
clockwise boolean true The direction of turn of progress line, if you pass false, the progress line will be reversed, default value is true.
startPosition double 0 (StartPosition.topCenter) Start position of progress line relative to the topCenter, you can pass a value from [StartPosition] class or custom double value you need.
strokeAlign SquareStrokeAlign SquareStrokeAlign.inside The stroke align of the progress line, pass a value from [SquareStrokeAlign] and read it's documents. see: https://api.flutter.dev/flutter/painting/BorderSide/strokeAlign.html
strokeCap StrokeCap? StrokeCap.round The stroke cap of the progress line and empty line, see: https://api.flutter.dev/flutter/dart-ui/StrokeCap.html
child Widget? null The child widget, it can be a text or everything you need.

Feel free to create issue or pull requests in github repository!

所屬分類

原始碼儲存庫

使用此套件的專案