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

simple_tooltip のカバー
パッケージ詳細v1.2.0

simple_tooltip

ツールチップを作成するためのシンプルなライブラリ

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

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

flutter pub add simple_tooltip

パッケージ概要

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

UI 要素にツールチップを簡単に追加できる軽量な Flutter パッケージです。ユーザーが特定のウィジェットにホバーまたはタップしたときに情報を表示するポップアップテキストを提供するシンプルな API を備え、最小限のセットアップでユーザーエクスペリエンスを向上させます。複雑なアニメーションやスタイルなしにコンテキストに応じたガイドが必要なアプリに最適です。モバイル、Web、デスクトップを含むすべての主要プラットフォームをサポートしています。

用途

  • フォームフィールドにコンテキストヘルプを追加する
  • アプリの機能についてユーザーを案内する
  • 記述的なヒントによるアクセシビリティの向上
  • ダッシュボードのツールチップの強化
  • アイコンにクイック情報表示
  • インタラクティブ要素に関するフィードバックの提供

主な機能

  • 最小構成
  • クロスプラットフォーム対応
  • カスタマイズ可能なツールチップの外観
  • タップおよびホバー操作をサポート
  • 軽量で高速
  • 既存のウィジェットとの簡単な統合

適している対象

  • 初心者のFlutter開発者
  • 簡単なツールチップを必要とするアプリ
  • アクセシビリティを重視したデザイン
  • プロトタイプと迅速な開発
  • 情報密度の高いレイアウトを備えたUI

注意事項

  • 限定された高度なアニメーションオプション
  • 複雑なレイアウトでは、ツールチップの位置を手動で調整する必要がある場合があります
  • キーボードナビゲーションの組み込みサポートなし
  • 基本的なユースケースに最適
  • デザインシステムとの整合性を確保するために、追加のスタイルが必要になる場合があります

元の README

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

simple_tooltip

A plugin for creating tooltips with shape of a balloon

You can customize multiple elements

💻 Installation

In the dependencies: section of your pubspec.yaml, add the following line:

dependencies:
  simple_tooltip: <latest version>

Usage

Basic

You can get started really simple, just add

Basic

SimpleTooltip(
        tooltipTap: () {
        print("Tooltip tap");
        },
        animationDuration: Duration(seconds: 3),
        show: true,
        tooltipDirection: TooltipDirection.up,
        child: Container(
        width: 200,
        height: 120,
        child: Placeholder(),
        ),
        content: Text(
        "Some text example!!!!",
        style: TextStyle(
            color: Colors.black,
            fontSize: 18,
            decoration: TextDecoration.none,
        ),
        ),
    ),

Full Api

/// The [child] which the tooltip will target to
  final Widget child;

  /// Sets the tooltip direction
  /// defaults to [TooltipDirection.up]
  final TooltipDirection tooltipDirection;

  /// Defines the content that its placed inside the tooltip ballon
  final Widget content;

  /// If true, it will display the tool , if false it will hide it
  final bool show;

  /// Sets the content padding
  /// defautls to: `const EdgeInsets.symmetric(horizontal: 20, vertical: 16),`
  final EdgeInsets ballonPadding;

  /// sets the duration of the tooltip entrance animation
  /// defaults to [460] milliseconds
  final Duration animationDuration;

  /// [top], [right], [bottom], [left] position the Tooltip absolute relative to the whole screen
  double top, right, bottom, left;

  /// [minWidth], [minHeight], [maxWidth], [maxHeight] optional size constraints.
  /// If a constraint is not set the size will ajust to the content
  double minWidth, minHeight, maxWidth, maxHeight;

  ///
  /// The distance of the tip of the arrow's tip to the center of the target
  final double arrowTipDistance;

  ///
  /// The length of the Arrow
  final double arrowLength;

  ///
  /// the stroke width of the border
  final double borderWidth;

  ///
  /// The minium padding from the Tooltip to the screen limits
  final double minimumOutSidePadding;

  ///
  /// The corder radii of the border
  final double borderRadius;

  ///
  /// The width of the arrow at its base
  final double arrowBaseWidth;

  ///
  /// The color of the border
  final Color borderColor;

  ///
  /// The color of the border
  final Color backgroundColor;

  ///
  /// Set a custom list of [BoxShadow]
  /// defaults to `const BoxShadow(color: const Color(0x45222222), blurRadius: 8, spreadRadius: 2),`
  final List<BoxShadow> customShadows;

  ///
  /// Set a handler for listening to a `tap` event on the tooltip (This is the recommended way to put your logic for dismissing the tooltip)
  final Function() tooltipTap;

  ///
  /// If you want to automatically dismiss the tooltip whenever a user taps on it, set this flag to [true]
  /// For more control on when to dismiss the tooltip please rely on the [show] property and [tooltipTap] handler
  /// defaults to [false]
  final bool hideOnTooltipTap;

  ///
  /// Pass a `RouteObserver` so that the widget will listen for route transition and will hide tooltip when
  /// the widget's route is not active
  final RouteObserver<PageRoute> routeObserver;

Screenshots

Animated
This plugin was inspired by super_tooltip

Getting Started

This project is a starting point for a Dart package, a library module containing code that can be shared easily across multiple Flutter or Dart projects.

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

カテゴリー

ソースリポジトリ

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

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