typethis 0.3.0 copy "typethis: ^0.3.0" to clipboard
typethis: ^0.3.0 copied to clipboard

A flutter package that aims to simplify versatile typing animation with rich text effects and other operations (reset, freeze, unfreeze).

example/lib/main.dart

import 'package:example/widgets/widgets.dart';
import 'package:flutter/material.dart';
import 'package:typethis/typethis.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    final typeThisWidget = TypeThis(
      string: 'Hi there! How are you doing?',
      speed: 100,
      style: const TextStyle(fontSize: 18),
    );

    final richTypeThisWidget = TypeThis(
      string: 'Welcome to the typethis package.',
      speed: 100,
      style: const TextStyle(fontSize: 18),
      softWrap: true,
      richTextMatchers: const [
        TypeThisMatcher(
          'typethis',
          style: TextStyle(
            fontWeight: FontWeight.bold,
            fontStyle: FontStyle.italic,
            decoration: TextDecoration.underline,
            decorationColor: Colors.indigo,
            color: Colors.indigo,
          ),
        ),
      ],
    );

    return MaterialApp(
      title: 'Flutter TypeThis Demo',
      theme: ThemeData(primarySwatch: Colors.deepPurple),
      home: Scaffold(
        appBar: AppBar(
          title: const Text('TypeThis Example'),
          backgroundColor: Colors.grey[200],
        ),
        body: Column(
          children: [
            SimpleDecoratedBox(
              typeThisWidget: typeThisWidget,
              onResetPressed: () => typeThisWidget.controller.reset(),
              onFreezePressed: () => typeThisWidget.controller.freeze(),
              onUnfreezePressed: () => typeThisWidget.controller.unfreeze(),
            ),
            const SizedBox(height: 16),
            RichDecoratedBox(
              typeThisWidget: richTypeThisWidget,
              onResetPressed: () => richTypeThisWidget.controller.reset(),
              onFreezePressed: () => richTypeThisWidget.controller.freeze(),
              onUnfreezePressed: () => richTypeThisWidget.controller.unfreeze(),
            ),
          ],
        ),
      ),
    );
  }
}
46
likes
150
points
323
downloads

Publisher

verified publisherthisissandipp.com

Weekly Downloads

A flutter package that aims to simplify versatile typing animation with rich text effects and other operations (reset, freeze, unfreeze).

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on typethis