The Animated Hint package allows you to animate the hint of a TextView effortlessly. This package provides a unique way to enhance the user experience by animating the hint, making your text input fields more interactive and visually appealing.
Add the package to your Flutter project by using the following command:
flutter pub add animated_hint
To use the animated hint feature, simply replace your traditional TextView with the AnimatedHintTextField
widget.
import 'package:flutter/material.dart';
import 'package:animated_hint/animated_hint.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: Text('Animated Hint TextField Example')),
body: Center(
child: AnimatedHintTextField(
fixedHint: "Search",
hints: const ['\"Flights\"', '\"Accounts\"'],
animationType: AnimationType.slide,
),
),
),
);
}
}
- Properties:
fixedHint
: This part of hint will remain fixed and will not animatehints
: List of hints to be animatedanimationType
: type of animation to be used for hints by default, [AnimationType.slide] will be usedfixedHintTextStyle
: style for fixed hint text if null, default [style] will be usedhintTextStyle
: style for animated hint text if null, default [style] will be used
We welcome contributions! If you have any ideas or improvements, feel free to create an issue or submit a pull request.
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Make your changes and commit them (
git commit -m 'Add new feature'
). - Push to the branch (
git push origin feature-branch
). - Open a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.
If you have any questions or need support, please create an issue on GitHub.
- Author: Dipanshu Singh
- GitHub: iamdipanshusingh
- Email: [email protected]