This library is for typing strings character by character.

Getting started

TODO: List prerequisites and provide or point to information on how to start using the package.

Demo Video

Parametrs

currentCharIndex (int): The current index of the character being typed within the current text string. Defaults to 0.

currentIndex (int): The index of the current text string within the textsCharacter list. Defaults to 0.

repeat (bool): If true, the typewriter effect will repeat from the beginning after finishing all text strings. Defaults to false.

textsCharacter (List

updateCallback (void Function(String)): A callback function that receives the current state of the text being typed, allowing it to be updated in the UI.

How To Use

If you want to know how to use the package, go to the example folder Directory: example/lib/homepage.dart

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

class HomePage extends StatefulWidget {
  const HomePage({super.key});

  @override
  State<HomePage> createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  AutoType autoType = AutoType();
  String displayText = '';
  @override
  void initState() {
    super.initState();
    autoType.typeWriter(
      repeat: false,
      textsCharacter: ["Hello Every One"],
      updateCallback: (p0) {
        setState(() {
          displayText = p0;
        });
      },
    );
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: SafeArea(
          child: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          Center(
            child: Text(displayText, style: const TextStyle(fontSize: 16)),
          )
        ],
      )),
    );
  }
}

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Libraries

auto_type