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

套件詳情v0.5.0

signal_strength_indicator

適用於 Flutter 的可自訂訊號強度指示器小部件。可輕鬆視覺化訊號強度。

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

安裝套件

flutter pub add signal_strength_indicator

套件介紹

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

一個可自訂的 Flutter 小工具,用於視覺化顯示訊號強度,非常適合網路連線監控。它提供了一種簡單的方式來顯示訊號等級,並支援可調整的樣式與行為。此指示器支援多個平台,包括 Android、iOS、Web、macOS、Windows 和 Linux,適用於跨平台應用程式。專為需要乾淨、即時反應的訊號視覺化但不需複雜實作的開發者設計。

適用情境

  • 網路狀態儀表板
  • 行動應用程式連接指示器
  • 物聯網設備連接監控
  • 即時訊號電平顯示
  • 使用者友善的網路回饋

主要特色

  • 可自定外觀
  • 跨平台相容性
  • 簡單整合
  • 響應式信號可視化
  • 可設定的訊號閾值

適合對象

  • 開發網路感知應用的開發者
  • 需要信號指示器的UI設計師
  • 需要即時連接反饋的應用程式
  • 跨平台移動和桌面應用
  • 依賴要求最少的專案

使用建議

  • 需要手動輸入信號值
  • 僅限視覺表示
  • 無內建訊號測量
  • 最佳搭配外部訊號資料來源使用
  • 可能需要額外的樣式來支援深色模式

原始 README

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

Signal strength indicator widget

Pub CI Demo

Customizable signal strength indicator widget for Flutter.

Contents

Requirements

  • Dart SDK: >=3.0.0
  • Flutter: >=3.10.0

Features

See the WEB DEMO.

Two visual variants:

  • Bars — classic stacked bars with optional rounded corners, bevelled style, and spacing
  • Sector — quarter-circle arc segments with optional rounded caps

Installation

Add this to your pubspec.yaml:

dependencies:
  signal_strength_indicator: ^0.5.0

Then run:

flutter pub get

Import in your Dart code:

import 'package:signal_strength_indicator/signal_strength_indicator.dart';

Usage

Bars
SignalStrengthIndicator.bars(
  value: 0.6,
  size: 40,
  barCount: 4,
  spacing: 0.2,
  activeColor: Colors.green,
  inactiveColor: Colors.grey.shade300,
)
Sector
SignalStrengthIndicator.sector(
  value: 0.6,
  size: 40,
  barCount: 4,
  spacing: 0.3,
  rounded: true,
)
Custom value range
SignalStrengthIndicator.bars(
  value: -65,     // e.g. RSSI in dBm
  minValue: -100,
  maxValue: -40,
  size: 40,
)
Threshold-based coloring with levels

levels is a Map<num, Color> mapping absolute thresholds to colors. A bar/segment becomes active and uses the color of the highest threshold that is <= the current value.

SignalStrengthIndicator.bars(
  value: signalValue,
  minValue: 0,
  maxValue: 100,
  size: 40,
  barCount: 3,
  levels: {
    33: Colors.red,
    66: Colors.orange,
    100: Colors.green,
  },
)
Rounded corners and bevelled bars
// Rounded corners
SignalStrengthIndicator.bars(
  value: 0.7,
  size: 40,
  radius: const Radius.circular(4),
)

// Bevelled (each bar steps up at an angle)
SignalStrengthIndicator.bars(
  value: 0.7,
  size: 40,
  bevelled: true,
)

Parameters

Common parameters (bars and sector)
Parameter Type Default Description
value num required Current signal value
minValue num? 0.0 Minimum value of the range
maxValue num? 1.0 Maximum value of the range
size double? icon theme size Width and height of the widget
barCount int 3 Number of bars/segments
activeColor Color? green Color of active bars (when no levels)
inactiveColor Color? light green Color of inactive bars
levels Map<num, Color>? — Threshold-to-color mapping (absolute values)
spacing double 0.2 / 0.3 Gap between bars as a fraction of bar size
margin EdgeInsets zero Outer margin around the widget
Bars-only parameters
Parameter Type Default Description
radius Radius? Radius.zero Corner radius of each bar
bevelled bool false Draw bars with an angled top edge
Sector-only parameters
Parameter Type Default Description
rounded bool false Use rounded arc cap ends

Feature requests and bugs

Please file feature requests and bugs at the issue tracker.

所屬分類

原始碼儲存庫

使用此套件的專案