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

rflutter_alert のカバー
パッケージ詳細v2.0.7

rflutter_alert

RFlutter Alert は、Flutter用の非常にカスタマイズ可能で使いやすいアラート/ポップアップダイアログです。再利用可能なアラートスタイルを作成したり、必要なだけボタンを追加したりできます。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
1.4万
いいね数
1070
Pub ポイント
150

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

flutter pub add rflutter_alert

パッケージ概要

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

RFlutter Alert は、Flutter アプリケーションでアラートやポップアップダイアログを作成するためのカスタマイズ可能で使いやすいパッケージです。開発者が無制限のボタンを備えた再利用可能なアラートスタイルを簡単に構築でき、アニメーション、色、コンテンツレイアウトなどのさまざまなカスタマイズオプションをサポートします。複数のプラットフォームで通知、確認、インタラクティブなプロンプトを表示するのに最適です。このパッケージは Flutter のウィジェットシステムとシームレスに統合されており、ratel.com.tr によってメンテナンスされています。

用途

  • 確認ダイアログの表示
  • カスタム通知を表示する
  • 再利用可能なアラートテンプレートの作成
  • ポップアップを介してユーザー入力を処理する
  • オンボーディングのヒントを実装する
  • フォーム検証アラートの管理

主な機能

  • 高度にカスタマイズ可能な外観
  • 複数のボタンをサポート
  • 再利用可能なアラートスタイル
  • 組み込みアニメーション
  • クロスプラットフォーム互換性
  • Flutter との簡単な統合

適している対象

  • 初心者のFlutter開発者
  • 頻繁なアラートが必要なアプリ
  • インタラクティブなUIコンポーネント
  • マルチプラットフォームアプリ
  • カスタムダイアログデザイン
  • 迅速なプロトタイピング

注意事項

  • 複雑なレイアウトには追加のスタイル設定が必要になる場合があります
  • 完全なUIライブラリと比較して、組み込みテーマが限られている
  • 多数のネストされたアラートによるパフォーマンスへの潜在的影響
  • 重いモーダルワークフローには向かない
  • ボタンコールバックの手動処理が必要です
  • シンプルから中程度の複雑さのダイアログに最適

元の README

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

RFlutter Alert

RFlutter Alert is super customizable and easy-to-use alert/popup dialogs for Flutter. You may create reusable alert styles or add buttons as much as you want with ease.

Version

Features

  • Single line basic alert
  • Adding buttons dynamically (as much as you want)
  • Predefined beautiful alert styles (success, error, warning, info)
  • Reusable alert styles
  • Super customizable
    • Change animation (fromTop, fromBottom, fromRight, fromLeft, grow, shrink) & Custom Animation
    • Set animation duration
    • Show/hide close button
    • Set overlay tap to dismiss
    • Assign Title and desc styles
    • Change dialog border style

Getting started

You must add the library as a dependency to your project.

dependencies:
 rflutter_alert: ^2.0.7

You can also reference the git repo directly if you want:

dependencies:
 rflutter_alert:
   git: git://github.com/RatelHub/rflutter_alert.git

You should then run flutter packages get

Example Project

There is a detailed example project in the example folder. You can directly run and play on it. There are code snippets from example project below.

Basic Alert

Alert(context: context, title: "RFLUTTER", desc: "Flutter is awesome.").show();

Alert with Button

    Alert(
      context: context,
      type: AlertType.error,
      title: "RFLUTTER ALERT",
      desc: "Flutter is more awesome with RFlutter Alert.",
      buttons: [
        DialogButton(
          child: Text(
            "COOL",
            style: TextStyle(color: Colors.white, fontSize: 20),
          ),
          onPressed: () => Navigator.pop(context),
          width: 120,
        )
      ],
    ).show();

Alert with Buttons

    Alert(
      context: context,
      type: AlertType.warning,
      title: "RFLUTTER ALERT",
      desc: "Flutter is more awesome with RFlutter Alert.",
      buttons: [
        DialogButton(
          child: Text(
            "FLAT",
            style: TextStyle(color: Colors.white, fontSize: 20),
          ),
          onPressed: () => Navigator.pop(context),
          color: Color.fromRGBO(0, 179, 134, 1.0),
        ),
        DialogButton(
          child: Text(
            "GRADIENT",
            style: TextStyle(color: Colors.white, fontSize: 20),
          ),
          onPressed: () => Navigator.pop(context),
          gradient: LinearGradient(colors: [
            Color.fromRGBO(116, 116, 191, 1.0),
            Color.fromRGBO(52, 138, 199, 1.0)
          ]),
        )
      ],
    ).show();

Alert with Style

AlertStyle

Use the AlertStyle class to customize.

    var alertStyle = AlertStyle(
      animationType: AnimationType.fromTop,
      isCloseButton: false,
      isOverlayTapDismiss: false,
      descStyle: TextStyle(fontWeight: FontWeight.bold),
      descTextAlign: TextAlign.start,
      animationDuration: Duration(milliseconds: 400),
      alertBorder: RoundedRectangleBorder(
        borderRadius: BorderRadius.circular(0.0),
        side: BorderSide(
          color: Colors.grey,
        ),
      ),
      titleStyle: TextStyle(
        color: Colors.red,
      ),
      alertAlignment: Alignment.topCenter,
    );

And assign your AlertStyle object to Alert's style field.

    Alert(
      context: context,
      style: alertStyle,
      type: AlertType.info,
      title: "RFLUTTER ALERT",
      desc: "Flutter is more awesome with RFlutter Alert.",
      buttons: [
        DialogButton(
          child: Text(
            "COOL",
            style: TextStyle(color: Colors.white, fontSize: 20),
          ),
          onPressed: () => Navigator.pop(context),
          color: Color.fromRGBO(0, 179, 134, 1.0),
          radius: BorderRadius.circular(0.0),
        ),
      ],
    ).show();

Alert with Custom Image

    Alert(
      context: context,
      title: "RFLUTTER ALERT",
      desc: "Flutter is better with RFlutter Alert.",
      image: Image.asset("assets/success.png"),
    ).show();

Alert with Custom Content

    Alert(
        context: context,
        title: "LOGIN",
        content: Column(
          children: <Widget>[
            TextField(
              decoration: InputDecoration(
                icon: Icon(Icons.account_circle),
                labelText: 'Username',
              ),
            ),
            TextField(
              obscureText: true,
              decoration: InputDecoration(
                icon: Icon(Icons.lock),
                labelText: 'Password',
              ),
            ),
          ],
        ),
        buttons: [
          DialogButton(
            onPressed: () => Navigator.pop(context),
            child: Text(
              "LOGIN",
              style: TextStyle(color: Colors.white, fontSize: 20),
            ),
          )
        ]).show();

Contributions

  • If you found a bug, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, submit a pull request.

Version compatability

See CHANGELOG for all breaking (and non-breaking) changes.


Made with ❤ by Ratel

カテゴリー

ソースリポジトリ

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