Viewing version 3.0.9. Open the latest package page.

typewritertext

3.0.9

A simple typewriter text animation wrapper for flutter. Supports iOS, Android, web, Windows, macOS, and Linux.

Download archive

Readme

Type Writer Text



A simple typewriter text animation wrapper for flutter, supports iOS, Android, web, Windows, macOS, and Linux.

Preview

Install

Add this line to your pubspec.yaml.

dependencies:
  typewritertext: ^3.0.9

Usage

First, import the typewriter package.

import 'package:typewritertext/typewritertext.dart';

And use it like this

TypeWriter.text(
  'lorem ipsum dolot sit amet ...',
  duration: const Duration(milliseconds: 50),
);

And for the builder, you need to initiate a controller like this one.

final controller = TypeWriterController(text: 'Hello World',
  duration: const Duration(milliseconds: 50),
);

// also if you want the typewriter to not only changing
// the character but also words, you can use this controller.

final valueController = TypeWriterController.fromValue(
  TypeWriterValue([
    'First Paragraph',
    'Next Paragraph',
    'Last Paragraph',
  ]),
  duration: const Duration(milliseconds: 50),
);

// you can also integrate the controller with Stream<String> like this one.

final streamController = TypeWriterController.fromStream(
  StreamController<String>().stream
);

TypeWriter(
  controller: controller, // valueController // streamController
  builder: (context, value) {
    return Text(
      value.text,
      maxLines: 2,
      minFontSize: 2.0,
    );
  }
);

Documentation

TypeWriter.text

Property Purpose
repeat Specifies whether the animation should repeat once completed (default is false).
enabled Is the flag to play the animation or not.
maintainSize Specifies whether the size of the layout text should be maintained.
duration Delay time between each character.
alignment Alignment of the text layout.
text The text to be displayed during the typewriter animation.
onChanged Callback function for when the text is changed.
textAlign Alignment of the text.
style Style of the text.
maxLines Maximum number of lines to be displayed.
overflow Overflow behavior of the text.
semanticsLabel Semantics label of the text.
softWrap Specifies whether the text should break at soft line breaks.
strutStyle Strut style of the text.
locale Locale of the text.
textDirection Text direction of the text.
textHeightBehavior Text height behavior of the text.
textWidthBasis Text width basis of the text.
selectionColor Color of the selection.
onFinished Is a callback that triggered when the animation is done. This requires [enabled] as true and repeat as false.

TypeWriter

Property Purpose
controller Controller that manage the animation. You can use TypeWriterController or TypeWriterController.fromValue.
enabled Is the flag to play the animation or not.
builder Builder that contains TypeWriterValue in sequence.
onFinished Is a callback that triggered when the animation is done. This requires [enabled] as true and repeat as false.

Example

  • typewritertext/example/lib/main.dart
Changelog

0.0.1

  • Initial release.

1.0.0

  • Add alignment and documentation.

1.1.0

  • Change documentation.

1.2.0

  • Hide Library.

1.3.0

  • Fix empty string case.

1.4.0

  • Fix state used after being disposed.

1.5.0

  • Migrate from provider to statefulwidget.

1.6.0

  • Update documentation.

1.7.0

  • Add Repeat & Dispose

1.8.0

  • Update Documentation

1.9.0

  • Add WidgetsBinding

2.0.0

  • Change Timer to TickerProvider

2.1.0

  • Add TypeWriterText.builder

2.2.0

  • Update pubspec

2.3.0

  • Fix Changelog

2.3.1-new

  • Remove deprecated textScaleFactor

3.0.0

  • Add TypeWriter v3

3.0.1

  • Calling stop before dispose

3.0.2

  • Add assertion of text length
  • Update readme

3.0.3

  • Add onFinished callback.

3.0.4

  • Added Mounted checker for safety
  • Deprecated TypeWriterText
  • Split the library into TypeWriter (v3) and TypeWriterText (v1)
  • Increase Unit Test

3.0.5

  • Fix README

3.0.6

  • Merge library

3.0.7

  • Fix text overflow clipped
  • Add TypeWriterController.fromStream
  • Support emoji in text

3.0.8

  • Add TypeWriterController.fromStream documentation
  • Add autorun parameter in TypeWriterController and TypeWriterController.fromValue
  • Add try and catch in getting index
  • Now support empty string

3.0.9

  • Add try & catch in returning text

Installing

export PUB_HOSTED_URL=https://pub.mirror.p-hatan.com
flutter pub add 'typewritertext:3.0.9'
pubspec.yaml
name: typewritertext
description: A simple typewriter text animation wrapper for flutter. Supports iOS, Android, web, Windows, macOS, and Linux.
version: 3.0.9
homepage: https://inidia.app
repository: https://github.com/Nialixus/typewritertext.git
issue_tracker: https://github.com/Nialixus/typewritertext/issues
funding:
  - https://ko-fi.com/nialixus
screenshots:
  - description: "TypeWriter Logo"
    path: logo.png
topics:
  - utility
  - animation

environment:
  sdk: ">=2.17.0 <4.0.0"
  flutter: ">=1.17.0"

dependencies:
  flutter:
    sdk: flutter

dev_dependencies:
  flutter_lints: ^3.0.1
  flutter_test:
    sdk: flutter

Version history

VersionPublishedArchiveSHA-256
0.0.1On demandDownloadf4fbbefa…3eacba
1.0.0On demandDownload78cc9d92…5108f0
1.1.0On demandDownload8931ba48…59fd6e
1.2.0On demandDownloadae0a9ab1…a31dfd
1.3.0On demandDownload230edc71…0b3990
1.4.0On demandDownloadc3c0f79c…6d2d23
1.5.0On demandDownload9c609a80…bd1321
1.6.0On demandDownload90ffdccb…93f429
1.7.0On demandDownloadcd85a69b…76e771
1.8.0On demandDownload2b69baf6…594e32
1.9.0On demandDownloadb21e3a5b…5e2b42
2.0.0On demandDownload9036d872…226858
2.1.0On demandDownload4b533690…93a3ed
2.2.0On demandDownloadb441bb15…5b9efa
2.3.0On demandDownload1b21e01d…69be0c
2.3.1-newOn demandDownload455bad9b…683ba0
2.3.1On demandDownloadd787ea21…bc4ed3
3.0.0On demandDownloadb065a2f5…22baac
3.0.1On demandDownload13cc8fa5…7d0e91
3.0.2On demandDownloadb7989683…286ffe
3.0.3On demandDownload918686ee…84912f
3.0.4On demandDownloadb1186604…937938
3.0.5On demandDownloadc13fe8c9…fea9c9
3.0.6On demandDownloadfc4a2ae6…5bb2db
3.0.7On demandDownload007e8b47…320a80
3.0.8On demandDownloadacfe1974…03f9c7
3.0.9Cached · Upstream SHA-256 matchedDownloadc6b90cdc…3212b2

Dependencies

flutter { "sdk": "flutter" }