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

animated_hint_textfield 封面
套件詳情v1.3.0

animated_hint_textfield

用於動畫化文字框提示/標籤文字的 Flutter 套件,加入動態且吸引眼球的過渡效果以提升使用者體驗。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
3460
喜歡數
107
Pub 分數
160

安裝套件

flutter pub add animated_hint_textfield

套件介紹

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

一個 Flutter 套件,可為文字欄位的提示或標籤文字添加動畫效果,在欄位獲得或失去焦點時創造流暢且動態的過渡效果。透過細微的動畫提供視覺反饋,提升使用者體驗,讓輸入欄位更具吸引力且直覺。非常適合注重美學與互動性的現代介面。此套件支援 Android、iOS、Web、macOS、Windows 與 Linux 多個平台,確保在各種裝置上行為一致。

適用情境

  • 透過視覺反饋增強表單輸入
  • 建立現代且互動式的登入畫面
  • 改進移動和網路應用的使用者體驗
  • 向文字欄位添加微互動
  • 設計視覺上吸引人的資料輸入表單

主要特色

  • 流暢的焦點與模糊動畫
  • 可自訂的動畫持續時間和曲線
  • 支援多個平台
  • 與現有文字欄位的輕鬆整合
  • 動態提示定位與縮放

適合對象

  • 尋求互動元件的UI/UX設計師
  • 開發人員建構精緻的表單
  • 注重使用者參與度的應用程式
  • 跨平台 Flutter 項目
  • 需要細膩卻有效動畫的專案

使用建議

  • 可能影響低階裝置的效能
  • 需要仔細調整動畫參數
  • 僅限提示/標籤文字動畫
  • 不適用於複雜的表單驗證邏輯
  • 依賴正確的元件層級以獲得最佳結果

原始 README

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

pub package pub points

Animated Hint TextField

A Flutter package designed to animate the label/hint text of a textfield, providing suggestive guidance to the user regarding what to input. Try out our example app.


Platform Support

Android iOS MacOS Web Linux Windows
✅ ✅ ✅ ✅ ✅ ✅



Installing

1. Depend on it

Add this to your package's pubspec.yaml file:

dependencies:
  animated_hint_textfield: ^1.0.0
2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get
3. Import it

Now in your Dart code, you can use:

import 'package:animated_hint_textfield/animated_hint_textfield.dart';



Animations

Currently this package supports 3 animations, more animations will be added in the future.

Slide

AnimatedTextField(
  animationType: Animationtype.slide, // Use Animationtype.slide for Slide animations
  decoration: InputDecoration(
    prefixIcon: Icon(Icons.search),
    border: OutlineInputBorder(
      borderSide: BorderSide(color: Colors.red, width: 2,
      ),
      borderRadius: BorderRadius.circular(4),
    ),
    focusedBorder: OutlineInputBorder(
      borderSide: BorderSide(color: Colors.black, width: 2,
      ),
      borderRadius: BorderRadius.circular(4),
    ),
    contentPadding: EdgeInsets.all(12),
  ),
  staticHintText: 'Search for ',
  hintTexts: [
    '"Bengaluru"',
    '"Mumbai"',
    '"Chennai"',
  ],
);

Fade

AnimatedTextField(
  animationType: Animationtype.fade, // Use Animationtype.fade for Fade animations
  decoration: InputDecoration(
    prefixIcon: Icon(Icons.search),
    border: OutlineInputBorder(
      borderSide: BorderSide(color: Colors.red, width: 2,
      ),
      borderRadius: BorderRadius.circular(4),
    ),
    focusedBorder: OutlineInputBorder(
      borderSide: BorderSide(color: Colors.black, width: 2,
      ),
      borderRadius: BorderRadius.circular(4),
    ),
    contentPadding: EdgeInsets.all(12),
  ),
  hintTexts: [
    'Search for "Bengaluru"',
    'Search for "Mumbai"',
    'Search for "Chennai"',
  ],
);

Typer

AnimatedTextField(
  animationType: Animationtype.typer, // Use Animationtype.typer for Type Write Style animations
  hintTextStyle: const TextStyle(
    color: Colors.deepPurple,
    overflow: TextOverflow.ellipsis,
  ),
  hintTexts: const [
    'How is the weather today?',
    'Will it rain today?',
    'What is the temperature',
  ],
  decoration: InputDecoration(
    suffixIcon: const Icon(Icons.search),
    filled: true,
    border: OutlineInputBorder(
      borderSide: const BorderSide(color: Colors.red, width: 2),
      borderRadius: BorderRadius.circular(25),
    ),
    focusedBorder: OutlineInputBorder(
      borderSide: const BorderSide(color: Colors.black, width: 2),
      borderRadius: BorderRadius.circular(25),
    ),
    contentPadding: const EdgeInsets.all(12),
  ),
);
💡 Tip

Use staticHintText when part of the hint should stay fixed while only the animated part changes:

AnimatedTextField(
  staticHintText: 'Search for ',
  hintTexts: const ['Bengaluru', 'Mumbai', 'Chennai'],
);

For suffix-style hints, set staticHintTextPosition:

AnimatedTextField(
  staticHintText: ' nearby',
  staticHintTextPosition: StaticHintTextPosition.suffix,
  hintTexts: const ['Cafe', 'Hotel', 'Restaurant'],
);

By default, the animated hint text can span multiple lines if the text is long. If you want to keep the hint on a single line and show overflow with ellipses (...), set the overflow property in hintTextStyle:

hintTextStyle: TextStyle(
  overflow: TextOverflow.ellipsis,
),

Contributors


Deekshith Shetty

Torregrossa François

所屬分類

依賴

依賴清單 1 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。