decoding_text_effect
DecodingTextEffect 위젯을 위한 플러터 패키지입니다. 선택할 수 있는 디코딩 효과가 5가지 있습니다.
DecodingTextEffect 위젯을 생성하기 위한 플러터 패키지입니다.
{"sdk":"flutter"}{"sdk":"flutter"}아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
Add this to your package's pubspec.yaml file:
dependencies:
decoding_text_effect: ^1.1.1
You can install packages from the command line:
$ flutter pub get
Now in your Dart code, you can use:
import 'package:decoding_text_effect/decoding_text_effect.dart';
Decoding effects occurs only for following two cases,
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);
List<String> myText = [
'Decoding Text\nEffect',
'Welcome to\nthe Dart Side!',
'I have 50\nwatermelons',
'Quick Maths,\n2 + 2 = 4'
];
Container(
height: 200,
width: 350,
color: Colors.pink[100],
padding: EdgeInsets.all(50),
child: DecodingTextEffect(
myText[index],
decodeEffect: DecodeEffect.fromStart,
textStyle: TextStyle(fontSize: 30),
),
),
Container(
height: 200,
width: 350,
color: Colors.yellow[100],
padding: EdgeInsets.all(50),
child: DecodingTextEffect(
myText[index],
decodeEffect: DecodeEffect.fromEnd,
textStyle: TextStyle(fontSize: 30),
),
),
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),
),
),
Container(
height: 200,
width: 350,
color: Colors.purple[100],
padding: EdgeInsets.all(50),
child: DecodingTextEffect(
myText[index],
decodeEffect: DecodeEffect.random,
textStyle: TextStyle(fontSize: 30),
),
),
Container(
height: 200,
width: 350,
color: Colors.blue[100],
padding: EdgeInsets.all(50),
child: DecodingTextEffect(
myText[index],
decodeEffect: DecodeEffect.all,
textStyle: TextStyle(fontSize: 30),
),
),
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.
Source code of the below app is available in the example directory of this package's github repository.
https://github.com/aadarsh-patel/decoding_text_effect/blob/master/example/display/demo_app.gif?raw=trueBelow are some other demonstration of DecoratingTextEffect widget. But the source code of below apps are not in this repository.
| https://github.com/aadarsh-patel/decoding_text_effect/blob/master/example/display/real_application.gif?raw=true | https://github.com/aadarsh-patel/decoding_text_effect/blob/master/example/display/matrix.gif?raw=true |