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

animated_toast_list のカバー
パッケージ詳細v2.0.0

animated_toast_list

このパッケージを使用する人は、より自由を感じるでしょう。このパッケージは汎用性があるため、希望するトーストを作成できます。

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

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

flutter pub add animated_toast_list

パッケージ概要

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

AnimatedToastList は、開発者が簡単にカスタマイズ可能なアニメーション付きトーストメッセージを作成できるFlutterパッケージです。汎用的かつ柔軟な設計により、ユーザーが独自のトーストの外観や動作を定義でき、ユニークな通知スタイルが必要なアプリケーションに最適です。Android、iOS、Web、macOS、Windows、Linuxなど、多数のプラットフォームをサポートしており、デバイス間で一貫したユーザー体験を実現します。滑らかなアニメーションと1つのコマンドによる簡単な統合により、複雑さを加えることなくアプリのフィードバックを強化します。

用途

  • カスタムアプリ内通知
  • アクション後のユーザーのフィードバック
  • インタラクティブUI要素
  • クロスプラットフォームトースト表示
  • リアルタイムのステータス更新

主な機能

  • 非常にカスタマイズ可能なトーストデザイン
  • スムーズなアニメーション効果
  • マルチプラットフォーム対応
  • Flutter とのシンプルな統合
  • 任意のトーストスタイル用の汎用テンプレート

適している対象

  • ユニークなトーストデザインを探している開発者
  • プラットフォームに依存しない通知を必要とするアプリ
  • ユーザー体験に重点を置くプロジェクト
  • UI重視のアプリケーション
  • 再利用可能な通知コンポーネントを望むチーム

注意事項

  • カスタムスタイルの知識が必要です
  • 複雑なアニメーションのパフォーマンスチューニングが必要になる可能性があります
  • 限定された組み込みテーマ
  • 頻繁なユーザー操作があるアプリに最適
  • 動的なトーストのための適切な状態管理に依存しています

元の README

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

Introduction

When using Flutter, did you ever want to show toast with the design you want? Also, did you want to list the toast and show it with the desired animation? Then you have found what you are looking for! This package is generic, so there will be no problem with your toast. This package supports all platforms.

Usage

To use this package, wrap any widget with ToastListOverlay, as in the example below. For more details, see the example.

Widget build(BuildContext context) {
    return ToastListOverlay<MyToastModel>(
      itemBuilder: (BuildContext context, MyToastModel item, int index,
          Animation<double> animation) {
        return ToastItem(
          animation: animation,
          item: item,
          onTap: () => context.hideToast(
              item,
              (context, animation) =>
                  _buildItem(context, item, index, animation)),
        );
      },
      child: MaterialApp(
        theme: ThemeData(
          primarySwatch: Colors.blue,
        ),
        home: const MainScreen(),
        debugShowCheckedModeBanner: false,
      ),
    );
  }
Property Default value Description
child Required Widget Wrapped widget
position Alignment.topCenter Specifies where toast to be displayed.
reverse false Reverse the Toast list.
limit 5 Specify how much toast to display.
itemBuilder Required ToastListItemBuilder The Toast widget is defined here.
width 375 Specifies the width of the toast.
timeoutDuration 5 seconds Specifies how long toast will be displayed.

Now you can call the context.showToast method to display your toast. You can see more details in the example.

  context.showToast(MyToastModel(ToastType.success.name, ToastType.success));

Note: MyToastModel is an example model.

To close the Toast, call the context.hideToast method.

context.hideToast(
  item,
  (context, animation) => ToastItem(
    animation: animation,
    item: item,
  ),
);

Live demo

Example

The figure below shows when the toast exceeds the limit.
2022-06-11_01-25-41_AdobeExpress

The figure below shows how to remove the toast by clicking the close button.
2022-06-11_01-25-41_AdobeExpress (1)

In the figure below, you can see the toast without any problems even if you navigate to another screen.
2022-06-11_01-25-41_AdobeExpress (2)

The figure below shows the toast list reversed.
2022-06-11_01-39-18_AdobeExpress

カテゴリー

ソースリポジトリ

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

データはまだありません。