搜尋套件、儲存庫與 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.

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。