搜索插件、代码仓与 APP 分类

插件详情v1.1.1

decoding_text_effect

一个用于 DecodingTextEffect 小部件的 Flutter 包。您有 5 种解码效果可供选择。

近 30 天下载
45
喜欢数
31
Pub 分数
40

安装插件

flutter pub add decoding_text_effect

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

一个 Flutter 包,提供 DecodingTextEffect 小部件,为文本提供五种不同的解码动画效果。通过模拟实时解码的动画效果,增强用户参与度,非常适合用于启动画面、加载指示器或动态 UI 元素。该包轻量且易于集成,支持自定义速度和样式选项。非常适合为应用程序增添现代、科技感十足的风格。

适合场景

  • 启动画面
  • 加载动画
  • 交互式 UI 元素
  • 游戏化界面
  • 动态文本显示

主要特点

  • 五个内置解码效果
  • 可自定义的动画速度
  • 与 Flutter 的简单集成
  • 轻量且高效
  • 支持自定义文本样式

适合对象

  • 寻求动画文本效果的应用开发者
  • 想要未来感UI元素的设计师
  • 具有交互式引导流程的项目
  • 教育类应用程序,内容引人入胜
  • 带有视觉反馈的游戏

使用建议

  • 仅限文本动画
  • 不支持非Flutter平台
  • 效果可能会影响低端设备的性能
  • 需要手动配置以进行高级自定义
  • 不适用于静态文本内容

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。


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.

所属分类

源码仓库

使用此插件的项目

暂无相关数据。