搜索插件、代码仓与 APP 分类

GitHub 代码仓deekshithx/animated_hint_textfield

animated_hint_textfield

deekshithx/animated_hint_textfield open-source repository details.

animated_hint_textfield 项目封面
星标
9
复刻
1
最近推送(UTC)
2026年6月20日
项目状态
未归档

原始 README

以下为英文项目原文快照,最新内容请访问 GitHub。

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
Deekshith Shetty GitHub avatar
GitHub 作者

Deekshith Shetty ↗

Flutter Developer, Arduino Prototype Developer, Firebase Engineer

EnercentBengaluru
语言DartC++CMakeSwiftHTMLCKotlinObjective-CShell

此仓库发布的插件

使用的依赖

依赖清单 4 项

如何选择适合项目的代码仓?

先按使用场景筛选,再比较项目活跃情况,最后到原始仓库核对使用要求。

  1. 通过仓库名、作者或描述搜索,再按技术分类缩小范围。
  2. 结合星标、复刻与最近推送比较项目;星标反映社区关注,不代表质量保证。
  3. 使用前在 GitHub 核对 README、许可证与 Issues。

来源与维护

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗