keyboard_typing 0.0.1
keyboard_typing: ^0.0.1 copied to clipboard
Displays Text widget as if it's being typed on a keyboard
KeyboardTyping Widget #
Getting Started #
This project is a starting point for a Flutter plug-in package, a specialized package that includes platform-specific implementation code for all.
For help getting started with Flutter development, view the online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.
Add
flutter pub add keyboard_typing
Import
import 'package:picture_button/keyboard_typing.dart';
🚀 Usage #
- If you don't define a
KeyboardTypingController
, TheKeyboardTyping
Widget plays automatically.
Create KeyboardTyping Widget ⌨
parameter | required | type | default |
---|---|---|---|
text | ✔️ | Text | |
controller | ❌ | KeyboardTypingController? | |
duration | ❌ | Duration? | Duration(milliseconds: 150) |
KeyboardTyping(
text: Text("Something Text"),
)
Play Typing Animation 🚩
KeyboardTypingController controller = KeyboardTypingController();
controller.play();
Stop Typing Animation 🚧
KeyboardTypingController controller = KeyboardTypingController();
controller.stop();
Listen Typing event state 🎈
controller.addStateEventListener((KeyboardTypingState state) {
setState(() {
switch (state) {
case KeyboardTypingState.idle:
// TODO: Handle this case.
case KeyboardTypingState.active:
// TODO: Handle this case.
case KeyboardTypingState.pause:
// TODO: Handle this case.
case KeyboardTypingState.stop:
// TODO: Handle this case.
case KeyboardTypingState.complete:
// TODO: Handle this case.
}
});
},);
// remove
// controller.removeStateEventListener(...);