2

In some apps (e.g., BlinkIt, Swiggy, etc.), the search field shows animated suggestions instead of a static placeholder. For example, the hint text rotates/animates between:

“Search fruits”

“Search vegetables”

“Search restaurants” animation like this

I want to achieve this effect in Flutter. Right now, the TextField only supports a single static hintText in InputDecoration.

Is there a clean way to implement this without manually building timers and animation controllers?

I tried to build with animated controller but its not smooth as expected

1 Answer 1

2

You can achieve this easily with the animated_hint_textfield package.
It allows you to pass a list of hints, and it will animate them smoothly inside the text field.

Example:

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

class DemoPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: AnimatedTextField(
          animationType: Animationtype.slide,
          hintTexts: [
            "Search fruits",
            "Search vegetables",
            "Search restaurants",
          ],
          textStyle: TextStyle(fontSize: 16, color: Colors.black),
          hintTextStyle: TextStyle(fontSize: 14, color: Colors.grey),
        ),
      ),
    );
  }
}

This creates a text field where the placeholder cycles through multiple hints with animation — exactly like the BlinkIt search field.

You can customise:

  • The list of hints (hintTexts)

  • Animation speed (animationDuration)

  • Text and hint styles

Sign up to request clarification or add additional context in comments.

1 Comment

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.