This flutter package contains a widget called DecodingTextEffect which is having some cool Decode Effects for texts.

Overview

This flutter package contains a widget called DecodingTextEffect which is having some cool Decode Effects for texts.


Installing

1. Depend on it

Add this to your package's pubspec.yaml file:

dependencies:
  decoding_text_effect: ^1.1.1

2. Install it

You can install packages from the command line:

$ flutter pub get

3. Import it

Now in your Dart code, you can use:

import 'package:decoding_text_effect/decoding_text_effect.dart';

Documentation

Decoding effects occurs only for following two cases,

  1. When the widget is rendered for the very first time.
  2. When the value of originalString parameter gets changed.
DecodingTextEffect(
   this.originalString, {
   @required this.decodeEffect,
   Key key,
   this.textStyle,
   this.textAlign,
   this.refreshDuration,
   this.eachCount = 5,
   this.onTap,
   this.onFinished,
  })  : assert(
         originalString != null,
         'A non-null String must be provided to a Decoding Text Effect Widget.',
        ),
        super(key: key);

Usage

List<String> myText = [
   'Decoding Text\nEffect',
   'Welcome to\nthe Dart Side!',
   'I have 50\nwatermelons',
   'Quick Maths,\n2 + 2 = 4'
  ];

1. DecodeEffect.fromStart

Container(
   height: 200,
   width: 350,
   color: Colors.pink[100],
   padding: EdgeInsets.all(50),
   child: DecodingTextEffect(
      myText[index],
      decodeEffect: DecodeEffect.fromStart,
      textStyle: TextStyle(fontSize: 30),
   ),
),

2. DecodeEffect.fromEnd

Container(
   height: 200,
   width: 350,
   color: Colors.yellow[100],
   padding: EdgeInsets.all(50),
   child: DecodingTextEffect(
      myText[index],
      decodeEffect: DecodeEffect.fromEnd,
      textStyle: TextStyle(fontSize: 30),
   ),
),

3. DecodeEffect.toMiddle

Container(
   height: 200,
   width: 350,
   color: Colors.green[100],
   padding: EdgeInsets.all(50),
   child: DecodingTextEffect(
      myText[index],
      decodeEffect: DecodeEffect.to_middle,
      textStyle: TextStyle(fontSize: 30),
   ),
),

4. DecodeEffect.random

Container(
   height: 200,
   width: 350,
   color: Colors.purple[100],
   padding: EdgeInsets.all(50),
   child: DecodingTextEffect(
      myText[index],
      decodeEffect: DecodeEffect.random,
      textStyle: TextStyle(fontSize: 30),
   ),
),

5. DecodeEffect.all

Container(
   height: 200,
   width: 350,
   color: Colors.blue[100],
   padding: EdgeInsets.all(50),
   child: DecodingTextEffect(
      myText[index],
      decodeEffect: DecodeEffect.all,
      textStyle: TextStyle(fontSize: 30),
   ),
),

refreshDuration and eachCount

The refreshDuration is an optional argument that is having a default value of Duration(milliseconds: 60). Shorter the value of refreshDuration, faster will be the effect and hence decreasing the duration of effect. refreshDuration is also the time gap between two consecutive setState() function calls.

The eachCount is also an optional argument that is having a default value of 5. It is the number of random characters that will be shown before showing the original character and then moving on to decode next character and this cycles repeat until the completion of effect.

Demo

Source code of the below app is available in the example directory of this package's github repository.

Below are some other demonstration of DecoratingTextEffect widget. But the source code of below apps are not in this repository.

You might also like...

Create your own custom SlideTransition combined with some animation in Flutter.

Create your own custom SlideTransition combined with some animation in Flutter.

Create your own custom SlideTransition combined with some animation in Flutter.

Jun 21, 2022

Arisslidetransition - Create your own custom SlideTransition combined with some animation in Flutter

Arisslidetransition - Create your own custom SlideTransition combined with some animation in Flutter

SlideTransition Animation - Flutter Create your own custom SlideTransition combi

Jan 9, 2022

Base Flutter widget which triggers rebuild only of props changed

pure_widget Base widget which triggers rebuild only if props changed Installation pubspec.yaml: dependencies: pure_widget: ^1.0.0 Example import 'da

Dec 12, 2022

A widget for stacking cards, which users can swipe horizontally and vertically with beautiful animations.

A widget for stacking cards, which users can swipe horizontally and vertically with beautiful animations.

A widget for stacking cards, which users can swipe horizontally and vertically with beautiful animations.

Jan 6, 2023

A flutter package which makes it easier to display the difference between two images.

A flutter package which makes it easier to display the difference between two images.

👏 Before After A flutter package which makes it easier to display the differences between two images.. The source code is 100% Dart, and everything r

Dec 30, 2022

A flutter package which will help you to generate pin code fields with beautiful design and animations

A flutter package which will help you to generate pin code fields with beautiful design and animations

A flutter package which will help you to generate pin code fields with beautiful design and animations. Can be useful for OTP or pin code inputs 🤓 🤓

Dec 23, 2022

A flutter package which display the library collapse according to the number of images associated with hero animation

A flutter package which display the library collapse according to the number of images associated with hero animation

👏 Gallery Collapse A flutter package which display the library collapse accordi

Sep 12, 2022

filterList is a flutter package which provide utility to search/filter data from provided dynamic list.

filterList is a flutter package which provide utility to search/filter data from provided dynamic list.

filter_list Plugin FilterList is a flutter package which provide utility to search/filter on the basis of single/multiple selection from provided dyna

Dec 24, 2022

A Flutter widget that easily adds the flipping animation to any widget

A Flutter widget that easily adds the flipping animation to any widget

flip_card A component that provides a flip card animation. It could be used for hiding and showing details of a product. How to use import 'package:fl

Dec 31, 2022
Comments
  • Need cancel timer when dispose

    Need cancel timer when dispose

    for fix this error

    E/flutter (17623): This error happens if you call setState() on a State object for a widget that no longer appears in the widget tree (e.g., whose parent widget no longer includes t
    he widget in its build). This error can occur when code calls setState() from a timer or an animation callback.
    E/flutter (17623): The preferred solution is to cancel the timer or stop listening to the animation in the dispose() callback. Another solution is to check the "mounted" property of
     this object before calling setState() to ensure the object is still in the tree.
    E/flutter (17623): This error might indicate a memory leak if setState() is being called because another object is retaining a reference to this State object after it has been remov
    ed from the tree. To avoid memory leaks, consider breaking the reference to this object during dispose().
    E/flutter (17623): #0      State.setState.<anonymous closure> (package:flutter/src/widgets/framework.dart:1197:9)
    E/flutter (17623): #1      State.setState (package:flutter/src/widgets/framework.dart:1232:6)
    E/flutter (17623): #2      _DecodingTextEffectState._startDecoding.<anonymous closure> (package:decoding_text_effect/decoding_text_effect.dart:234:9)
    E/flutter (17623): #3      _rootRunUnary (dart:async/zone.dart:1134:38)
    E/flutter (17623): #4      _CustomZone.runUnary (dart:async/zone.dart:1031:19)
    E/flutter (17623): #5      _CustomZone.runUnaryGuarded (dart:async/zone.dart:933:7)
    E/flutter (17623): #6      _CustomZone.bindUnaryCallbackGuarded.<anonymous closure> (dart:async/zone.dart:970:26)
    E/flutter (17623): #7      _rootRunUnary (dart:async/zone.dart:1138:13)
    E/flutter (17623): #8      _CustomZone.runUnary (dart:async/zone.dart:1031:19)
    E/flutter (17623): #9      _CustomZone.bindUnaryCallback.<anonymous closure> (dart:async/zone.dart:954:26)
    E/flutter (17623): #10     _Timer._runTimers (dart:isolate-patch/timer_impl.dart:398:19)
    E/flutter (17623): #11     _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:429:5)
    E/flutter (17623): #12     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
    
    opened by bigzhu 1
Owner
Aadarsh Patel
A Flutter fanboy
Aadarsh Patel
☀ī¸ A Flutter package for some material design app intro screens with some cool animations.

IntroViews is inspired by Paper Onboarding and developed with love from scratch. Checkout our fully responsive live example app. Table of contents Fea

Ayush Agarwal 652 Dec 30, 2022
A sample for having PageView transformation effects in Flutter.

What is it? The end result looks a little something like this: Sample project for creating nice looking PageView parallax effects in Flutter. Read the

Iiro Krankka 811 Dec 22, 2022
Like Button is a flutter library that allows you to create a button with animation effects similar to Twitter's heart when you like something and animation effects to increase like count.

like_button Language: English | 中文įŽ€äŊ“ Like Button is a flutter library that allows you to create a button with animation effects similar to Twitter's h

FlutterCandies 357 Dec 27, 2022
🔔 A flutter package to create cool and beautiful text animations. [Flutter Favorite Package]

Animated Text Kit A flutter package which contains a collection of some cool and awesome text animations. Recommended package for text animations in C

Ayush Agarwal 1.4k Jan 6, 2023
Render After Effects animations natively on Flutter. This package is a pure Dart implementation of a Lottie player.

Lottie for Flutter Lottie is a mobile library for Android and iOS that parses Adobe After Effects animations exported as json with Bodymovin and rende

Xavier H. 894 Jan 2, 2023
Facilitator for having a Splash Screen with a Flare animation

flare_splash_screen Facilitator for having a Splash screen with a Flare animation until some work has been done for the initialization of the app If y

Jimmy Aumard 94 Oct 6, 2022
Render After Effects animations natively on Flutter

Draw Lottie files on a Flutter Widget

Bouziani Mohammed 2 Mar 10, 2022
Add particle effects to anything.

Showcase Features Highly customizable (Don't like my particle effects? Make your own with little effort!) Very easy to use A lot of premade particles

Norbert Kozsir 271 Oct 2, 2022
Cool 3D Drawer Animated With flutter part 2 đŸ”Ĩ đŸ”Ĩ

Cool 3D Drawer Animated With flutter part 2 ?? ??

Hmida 12 Nov 22, 2022
A growing collection of cool, elegant, efficient and performance-optimized animation widgets.

im_animations About A growing collection of cool, elegant, efficient and performance-optimized animation widgets. Feedback For any feedback please fil

iMujtaba Nazki 17 Nov 13, 2022