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

custom_pointed_popup のカバー
パッケージ詳細v0.0.4

custom_pointed_popup

任意のターゲットウィジェットに表示できるポップアップで、カスタム矢印デザインが可能。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
116
いいね数
23
Pub ポイント
130

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

flutter pub add custom_pointed_popup

パッケージ概要

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

任意の特定ウィジェットに固定されたカスタマイズ可能な矢印付きポップアップを表示できるFlutterパッケージです。方向性のある矢印を備えた独自のデザインをサポートしており、ツールチップやコンテキストヘルプに最適です。ターゲットに対して正確に配置でき、モバイル、ウェブ、デスクトップを含むすべての主要プラットフォームで互換性があります。UIフローを妨げることなく視覚フィードバックを提供することで、ユーザー体験を向上させます。

用途

  • ボタンにツールチップを表示する
  • カスタムコンテキストメニューの作成
  • フォームフィールドの強調表示
  • インタラクティブなガイドを提供する
  • ウィジェットの近くに動的情報を表示する

主な機能

  • カスタマイズ可能なポインター形状
  • ターゲットウィジェットに対する正確な位置
  • 複数プラットフォームレンダリングのサポート
  • カスタムウィジェットによる拡張可能なデザイン
  • スムーズなアニメーション遷移

適している対象

  • インタラクティブ要素を探しているUI/UXデザイナー
  • ガイド付きオンボーディングフローを構築する開発者
  • コンテキストヘルプシステムを必要とするアプリ
  • 豊富なインタラクティブインターフェースを備えたプロジェクト
  • クロスプラットフォームアプリ用にFlutterを使用するチーム

注意事項

  • 慎重なレイアウト管理が必要です
  • 複雑なデザインには追加のスタイルが必要になる場合があります
  • 多数の同時ポップアップによるパフォーマンスへの影響
  • 限定された組み込みテーマ、カスタム実装が必要
  • サイズ制限のため、大きなコンテンツ領域には適していません

元の README

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

custom_pointed_popup

Popup that can be shown on any targeted widget with customized pointed design.

Screenshots

alt text alt text alt text alt text

Getting Started

Example
  final GlobalKey widgetKey = GlobalKey();

  CustomPointedPopup getCustomPointedPopup(BuildContext context) {
    return CustomPointedPopup(
      backgroundColor: Colors.red,
      context: context,
      lineColor: Colors.tealAccent,
      widthFractionWithRespectToDeviceWidth: 3,
      displayBelowWidget: true,
      triangleDirection: TriangleDirection.FullLeft,
      popupElevation: 10,

      ///you can also add border radius
      ////popupBorderRadius:,
      item: CustomPointedPopupItem(
        title: 'Popup that can be shown on any targeted widget with customized pointed design.',
        textStyle: Theme.of(context).textTheme.caption!.copyWith(
              color: Theme.of(context).cardColor,
            ),
        iconWidget: Icon(
          Icons.add_moderator,
          color: Theme.of(context).cardColor,
        ),

        ///Or you can add custom item widget below instead above 3
        ///itemWidget: Container(),
      ),
      onClickWidget: (onClickMenu) {
        print('popup item clicked');
      },
      onDismiss: () {
        print('on dismissed called');
      },
    );
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(
          'Custom Pointed Popup [CPP]',
        ),
      ),
      body: Container(
        child: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Text(
                'CPP with straight pointer & item.',
                style: TextStyle(
                  color: Colors.red,
                  fontSize: 14.0,
                  fontStyle: FontStyle.italic,
                  fontWeight: FontWeight.bold,
                ),
              ),
              SizedBox(
                height: 40,
              ),
              GestureDetector(
                onTap: () {
                  getCustomPointedPopup(context)
                    ..show(
                      widgetKey: widgetKey,
                    );
                },
                child: Card(
                  key: widgetKey,
                  elevation: 10,
                  shape: RoundedRectangleBorder(
                    borderRadius: BorderRadius.circular(20),
                  ),
                  child: Container(
                    height: 100,
                    width: 100,
                    child: Center(
                      child: Text(
                        'Click Me \nTo\n Display CPP',
                        textAlign: TextAlign.center,
                        overflow: TextOverflow.clip,
                        style: TextStyle(
                          color: Colors.blueGrey,
                          fontWeight: FontWeight.w900,
                          fontSize: 14.0,
                        ),
                      ),
                    ),
                  ),
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }

Important Class, Function And Enum

The important class to know. CustomPointedPopupItem - Model item to display inside the pointed popup:

Attribute Type Default Required Description
iconWidget Widget No This will create an icon inside the pointed popup.
title String No Title or text for the pointed popup.
textStyle TextStyle No Text style for the title.
textAlign TextAlign No Alignment for the title.
itemWidget Widget No Custom item widget or child for the pointed popup. No need to add iconWidget & title if you added this.

The important function to know. show - Function to show the custom pointed popup:

Attribute Type Default Required Description
rect Rect No The rect bound that the popup should appear around it.
widgetKey GlobalKey No The key to widget.
item CustomPointedPopupItem [class] No If you want the dynamic item widget or child inside the popup per action, you can add the item here.

The important enum to know. TriangleDirection - Enum to choose the direction of pointer or triangle shape:

Value Description
Straight This will create an pointer with straight upward.
Right This will create an pointer with slightly bended towards right.
FullRight This will create an pointer with fully bended towards right.
Left This will create an pointer with slightly bended towards left.
FullLeft This will create an pointer with fully bended towards left.

In order to create a custom pointed popup on the widget, there are several attributes that are supported by custom_pointed_popup:

Attribute Type Default Required Description
item CustomPointedPopupItem [class] Yes To create the item widget or child in pointed popup.
customHeight double Yes The custom height of the pointed popup.
displayBelowWidget bool false No If true always display the popup below the widget else automatically calculate the space and display the popup either up or below the widget.
triangleDirection TriangleDirection [enum] TraingleDirection.Straight No Determines the direction of pointer or triangle shape.
popupBorderRadius BorderRadius BorderRadius.circular(10.0) No Defines the border of the custom pointed popup.
popupElevation double 0 No The elevation of the pointed popup.
stateChanged Function(bool isShow) No This event function will fire immediately the the popup state changes.
backgroundColor Color Colors.red No Background color for pointed popup.
widthFractionWithRespectToDeviceWidth int 3 No Width ratio with respect to the device width.
onDismiss VoidCallBack No Callback function that fire when the custom pointed popup dismissed.
onClickWidget Function(CustomPointedPopupItem item) No Callback function that fire when the child of popup is clicked.
context BuildContext Yes Context where the popup to be shown.

##If you have any queries, email me to dipak.shrestha@eemc.edu.np

CREDITS

Contributors

Made with contributors-img.

カテゴリー

ソースリポジトリ

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

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