搜尋套件、儲存庫與 APP 分類

el_tooltip 封面
套件詳情v2.2.1

el_tooltip

ElTooltip,一個智慧定位的提示工具。用於在提示工具中顯示可自訂的 widget。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
6760
喜歡數
163
Pub 分數
150

安裝套件

flutter pub add el_tooltip

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

ElTooltip 是一個可自定義的、智慧定位的工具提示元件,適用於 Flutter 應用程式。它允許開發者在工具提示中顯示個人化內容,該內容會根據可用空間和螢幕邊界自動調整位置。非常適合透過上下文資訊提升使用者體驗,而不會讓介面雜亂。此套件支援 Android、iOS、Web、macOS、Windows 與 Linux 多個平台,確保在不同裝置上的行為一致。透過 pub add 簡單整合,提供一種優雅的解決方案,僅需最少設定即可新增工具提示。

適用情境

  • 新增上下文幫助文字
  • 懸停或輕觸時顯示額外資訊
  • 增強使用者介面的可存取性
  • 提供對互動元件的回饋
  • 在跨平台應用程式中建立工具提示

主要特色

  • 智慧自動定位
  • 可自訂的提示內容
  • 跨平台相容性
  • 與 pub 的輕鬆整合
  • 支援觸控與懸停互動
  • 所需設定最少

適合對象

  • 尋求輕量級工具提示的開發者
  • 需要可存取性 UI 增強功能的應用程式
  • 針對多個平台的專案
  • 希望靈活設定提示框樣式的設計師
  • 重視快速實施的團隊

使用建議

  • 可能需要手動處理複雜版面
  • Tooltip 的可見性取決於父級 widget 的約束條件
  • 有限的內建動畫選項
  • 最適合用於簡單或中等複雜度的提示工具
  • 高頻率使用情境下的效能影響

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

ElTooltip - a smart positioned tooltip

Why el_tooltip?

  • 📦 Add widget elements to your tooltip
  • ↔️ Chose the preferred position for the tooltip to appear relative to the button
  • ↩️ The position changes automagically if the desired one doesn't fit the screen
  • ✅ No external dependencies
  • ❤️ Customizable layout
  • 🛡️ Null safety

Getting Started

🍭 Installation

Add to your pubspec.yaml

dependencies:
  el_tooltip: <last_version>

Import the library and call the Widget ElTooltip() with the required fields child and content

import 'package:flutter/material.dart';
import 'package:el_tooltip/el_tooltip.dart';

void main() {
  runApp(MaterialApp(
    title: 'Flutter Demo',
    theme: ThemeData(
      primarySwatch: Colors.blue,
    ),
    home: const SafeArea(
      child: Center(
        child: ElTooltip(
          child: Icon(Icons.info_outline),
          content: Text('This is a tooltip'),
        ),
      ),
    ),
  ));
}

Full example

🏷️ El Tooltip widget properties
Properties Required Default Description
content true What will appear inside the tooltip.
child true Widget that represent the button to activate the tooltip (no click method required).
color false Colors.white Background color of the bubble and the arrow.
distance false 10.0 Space between the child button and the tooltip.
padding false EdgeInsets.all(14.0) Tooltip padding around the content widget.
position false topCenter Desired position based on the Enum ElTooltipPosition. Can be topStart, topCenter, topEnd, rightStart, rightCenter, rightEnd, bottomStart, bottomCenter, bottomEnd, leftStart, leftCenter, leftEnd,
radius false Radius.circular(8.0) Border radius of the tooltip.
showModal false true Displays a fullscreen dark layer behind the tooltip.
showArrow false true Displays the arrow pointing to the child widget.
showChildAboveOverlay false true Repeats the child above the tooltip overlay.
modalConfiguration false ModalConfiguration() Configures the modal color and opacity if showModal is true.
timeout false Duration.zero (only disappears on click) How many time to wait for the tooltip to disappear.
appearAnimationDuration false Duration.zero (does not animate) Fade In animation duration.
disappearAnimationDuration false Duration.zero (does not animate) Fade Out animation duration.
controller false null ElTooltipController to show and hide the tooltip.
↔️ El Tooltip available positions

El tooltip header image was created using macrovector illustration on Freepik

Contributors ✨

Thanks goes to these wonderful people:


Marcelo Gil

💻

Matteo Pietro Dazzi

💻

Grzegorz Leoniec

💻

所屬分類

原始碼儲存庫

使用此套件的專案