FLUTTER ECOSYSTEM

yako-dev/flutter-status-alert

顯示類似 Apple 系統的自動隱藏狀態警告。非常適合在不中斷使用者流程的情況下通知使用者。

flutter-status-alert 專案封面
Stars
130
Forks
12
最近推送(UTC)
2026年4月9日
專案狀態
未封存
Yako GitHub avatar
GITHUB Organization

Yako ↗

Great mobile apps with Flutter

語言DartPythonSwiftHTMLKotlinObjective-C

技術主題

此儲存庫發佈的套件

使用的依賴

依賴清單 3 項
  • flutter{"sdk":"flutter"}
  • flutter_test開發依賴{"sdk":"flutter"}
  • flutter_lints開發依賴^5.0.0

原始 README

以下為英文專案原文快照,最新內容請造訪 GitHub。

展開 / 收合專案 README

Status Alert for Flutter

Pub Version CI

https://raw.githubusercontent.com/yako-dev/flutter-status-alert/master/assets/status_alert_logo.png

Display Apple system-like self-hiding status alerts. Well suited for notifying users without interrupting their flow.

Installing

dependencies:
  status_alert: ^2.0.0
import 'package:status_alert/status_alert.dart';

Basic Usage

StatusAlert.show(
  context,
  duration: Duration(seconds: 2),
  title: 'Subscribed',
  subtitle: 'You will be notified of new posts',
  configuration: IconConfiguration(icon: Icons.done),
  maxWidth: 260,
);

Parameters

Parameter Type Default Description
title String? null Main text
subtitle String? null Secondary text
configuration PopupMediaConfiguration? null Icon or custom widget
duration Duration 1300ms How long the alert stays visible
backgroundColor Color? Theme-based Alert background
blurPower double 2.0 Background blur sigma
maxWidth double? null Max width on large screens
alignment Alignment center Alert position on screen
margin EdgeInsets all(40) Outer spacing
padding EdgeInsets all(30) Inner spacing
borderRadius BorderRadius circular(10) Corner radius
dismissOnBackgroundTap bool false Dismiss when background is tapped
onComplete VoidCallback? null Called after dismiss animation ends
titleOptions StatusAlertTextConfiguration? null Title text styling
subtitleOptions StatusAlertTextConfiguration? null Subtitle text styling

Media Configurations

Icon
StatusAlert.show(
  context,
  title: 'Done',
  configuration: IconConfiguration(
    icon: Icons.check_circle,
    color: Colors.green,
    size: 60,
  ),
);
Custom Widget (e.g. Rive animation)
StatusAlert.show(
  context,
  title: 'Loading',
  configuration: WidgetConfiguration(
    widget: RiveAnimation.asset('assets/animation.riv'),
  ),
);

Programmatic Control

// Show
StatusAlert.show(context, title: 'Saved');

// Hide manually
StatusAlert.hide();

// Check visibility
if (StatusAlert.isVisible) { ... }

onComplete Callback

Called after the alert finishes its dismiss animation:

StatusAlert.show(
  context,
  title: 'Uploaded',
  onComplete: () => Navigator.push(context, ...),
);

Migration from 1.x

1.x 2.x
FlareConfiguration Use WidgetConfiguration with a Rive widget
textScaleFactor in StatusAlertTextConfiguration Use textScaler
Dart SDK <3.0.0 Requires Dart >=3.0.0

Apple Podcasts vs Status Alert

https://raw.githubusercontent.com/yako-dev/flutter-status-alert/master/assets/apple_podcasts_subscribed_animation.gif https://raw.githubusercontent.com/yako-dev/flutter-status-alert/master/assets/status_alert_subscribed_animation.gif

License

This project is licensed under the Apache License 2.0 — see the LICENSE file for details.