搜索插件、代码仓与 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.

所属分类

源码仓库

使用此插件的项目