パッケージ、リポジトリ、アプリカテゴリを検索

flutter_smart_dialog のカバー
パッケージ詳細v5.3.1

flutter_smart_dialog

洗練されたFlutterダイアログソリューション。トースト、ローディング、カスタムダイアログを簡単に実装し、ダイアログの使用をより簡単にしてください!

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
1.8万
いいね数
645
Pub ポイント
160

パッケージをインストール

flutter pub add flutter_smart_dialog

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

flutter_smart_dialog は、トーストメッセージ、ローディングインジケーター、カスタムダイアログを含むダイアログの実装を簡素化する軽量で洗練されたFlutterパッケージです。複数のプラットフォームでさまざまな種類のポップアップUI要素を表示するための明確かつ一貫したAPIを提供します。最小限のセットアップと直感的なメソッドにより、開発者は繰り返しコードを書かずにユーザーのフィードバックやインタラクションを迅速に向上させることができます。このパッケージはAndroid、iOS、Web、macOS、Windows、Linuxをサポートしており、クロスプラットフォームアプリケーションにおいて一貫したダイアログ体験を求める場合に最適です。

用途

  • トースト通知を表示する
  • 非同期操作中にロードインジケーターを表示する
  • カスタマイズ可能なダイアログオーバーレイの作成
  • 迅速なユーザーのフィードバックメカニズムの実装
  • マルチスクリーンアプリでのモーダルダイアログの管理

主な機能

  • シンプルで直感的な API
  • トースト、ローディング、カスタムダイアログをサポート
  • クロスプラットフォーム互換性
  • 最小限のボイラープレートコード
  • カスタマイズ可能なアニメーションとテーマ
  • 既存のFlutterプロジェクトとの簡単な統合

適している対象

  • クロスプラットフォームのFlutterアプリを開発する開発者
  • 一貫したUIフィードバックが必要なチーム
  • 軽量な通知ソリューションを必要とするプロジェクト
  • 頻繁なユーザー操作のプロンプトを持つアプリ
  • UX向上に注力するフロントエンド開発者

注意事項

  • 非常にカスタマイズされた外観には追加のスタイル設定が必要になる場合があります
  • ダイアログ形式のUIコンポーネントに限定
  • Flutter のレンダリングパイプラインに依存しています
  • 複雑なナビゲーションワークフローには適していません
  • 他の状態管理ソリューションと併用するのが最適です

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

pub stars issues commit

Feature and Usage(Must read!):super detailed guide

功能和用法(必看!): 超详细指南


Language: English | 中文

Migrate doc:3.x migrate 4.0 | 3.x 迁移 4.0

Flutter 2:Please use flutter_smart_dialog: 4.2.5

Introduction

An elegant Flutter Dialog solution.

Some Effect

attachLocationAndPoint

attachHighlight

dialogStack

loadingCustom

toastCustom

Advantage

  • Do not need BuildContext

  • Can penetrate dark background, click on the page behind dialog

  • Support dialog stack,close the specified dialog

  • Support positioning widget, display the specified location dialog

  • Support highlight feature,dissolve the specified location mask

  • Easily implement toast,loading,attach dialog,custome dialog,custome notify

Quick start

Install

Initialization

initialization

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: HomePage,
      // here
      navigatorObservers: [FlutterSmartDialog.observer],
      // here
      builder: FlutterSmartDialog.init(),
    );
  }
}

Advanced initialization: configure global custom Loading and Toast

SmartDialog's showLoading and showToast provide a default style. Of course, custom param are definitely supported.

  • SmartDialog custom Loading or Toast is very simple: However, when using it, it may make you feel a little troublesome
  • for example
    • Use custom Loading: SmartDialog.showLoading(builder: (_) => CustomLoadingWidget);
    • The effect we want must be like this: SmartDialog.showLoading();
  • In view of the above considerations, I added the function of setting custom default Loading and Toast styles at the entrance

Let me show you the following

  • The entry needs to be configured: implement toastBuilder and loadingBuilder, and pass in custom Toast and Loading
void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: HomePage,
      // here
      navigatorObservers: [FlutterSmartDialog.observer],
      // here
      builder: FlutterSmartDialog.init(
        //custom default toast widget
        toastBuilder: (String msg) => CustomToastWidget(msg: msg),
        //custom default loading widget
        loadingBuilder: (String msg) => CustomLoadingWidget(msg: msg),
        //custom default notify widget
        notifyStyle: FlutterSmartNotifyStyle(
          successBuilder: (String msg) => CustomSuccessWidget(msg: msg),
          failureBuilder: (String msg) => CustomFailureWidget(msg: msg),
          warningBuilder: (String msg) => CustomWarningWidget(msg: msg),
          alertBuilder: (String msg) => CustomAlertWidget(msg: msg),
          errorBuilder: (String msg) => CustomErrorWidget(msg: msg),
        ),
      ),
    );
  }
}
  • SmartDialog supports default global configuration
SmartDialog.config
  ..custom = SmartConfigCustom(
    maskColor: Colors.black.withOpacity(0.35),
    useAnimation: true,
  )
  ..attach = SmartConfigAttach(
    animationType: SmartAnimationType.scale,
    usePenetrate: false,
  )
  ..loading = SmartConfigLoading(
    clickMaskDismiss: false,
    leastLoadingTime: const Duration(milliseconds: 0),
  )
  ..toast = SmartConfigToast(
    intervalTime: const Duration(milliseconds: 100),
    displayTime: const Duration(milliseconds: 2000),
  );

Easy usage

  • toast usage💬
SmartDialog.showToast('test toast');

toastDefault

  • loading usage⏳
SmartDialog.showLoading();
await Future.delayed(Duration(seconds: 2));
SmartDialog.dismiss(); 

loadingDefault

  • dialog usage🎨
SmartDialog.show(builder: (context) {
  return Container(
    height: 80,
    width: 180,
    decoration: BoxDecoration(
      color: Colors.black,
      borderRadius: BorderRadius.circular(10),
    ),
    alignment: Alignment.center,
    child:
    Text('easy custom dialog', style: TextStyle(color: Colors.white)),
  );
});

dialogEasy

カテゴリー

依存関係

依存関係一覧 2 件

ソースリポジトリ

このパッケージを使用しているプロジェクト