diff --git a/analysis_options.yaml b/analysis_options.yaml new file mode 100644 index 0000000..108d105 --- /dev/null +++ b/analysis_options.yaml @@ -0,0 +1 @@ +include: package:pedantic/analysis_options.yaml diff --git a/example/lib/main.dart b/example/lib/main.dart index 1fcb0d5..21bbaa5 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -4,14 +4,14 @@ import 'package:animated_text_kit/animated_text_kit.dart'; void main() => runApp(MyApp()); const List labels = [ - "Rotate", - "Fade", - "Typer", - "Typewriter", - "Scale", - "Colorize", - "TextLiquidFill", - "Wavy Text" + 'Rotate', + 'Fade', + 'Typer', + 'Typewriter', + 'Scale', + 'Colorize', + 'TextLiquidFill', + 'Wavy Text' ]; class MyApp extends StatefulWidget { @@ -47,7 +47,7 @@ class MyHomePage extends StatefulWidget { } class _MyHomePageState extends State { - List _textAnimationKit = [ + final _textAnimationKit = [ ListView( scrollDirection: Axis.horizontal, children: [ @@ -59,7 +59,7 @@ class _MyHomePageState extends State { height: 100.0, ), Text( - "Be", + 'Be', style: TextStyle(fontSize: 43.0), ), SizedBox( @@ -68,13 +68,13 @@ class _MyHomePageState extends State { ), RotateAnimatedTextKit( onTap: () { - print("Tap Event"); + print('Tap Event'); }, isRepeatingAnimation: true, totalRepeatCount: 10, - text: ["AWESOME", "OPTIMISTIC", "DIFFERENT"], + text: ['AWESOME', 'OPTIMISTIC', 'DIFFERENT'], // alignment: Alignment(1.0, 0.5), - textStyle: TextStyle(fontSize: 40.0, fontFamily: "Horizon"), + textStyle: TextStyle(fontSize: 40.0, fontFamily: 'Horizon'), ), ], ), @@ -82,60 +82,60 @@ class _MyHomePageState extends State { ), FadeAnimatedTextKit( onTap: () { - print("Tap Event"); + print('Tap Event'); }, - text: ["do IT!", "do it RIGHT!!", "do it RIGHT NOW!!!"], + text: ['do IT!', 'do it RIGHT!!', 'do it RIGHT NOW!!!'], textStyle: TextStyle(fontSize: 32.0, fontWeight: FontWeight.bold), ), SizedBox( width: 250.0, child: TyperAnimatedTextKit( onTap: () { - print("Tap Event"); + print('Tap Event'); }, text: [ - "It is not enough to do your best,", - "you must know what to do,", - "and then do your best", - "- W.Edwards Deming", + 'It is not enough to do your best,', + 'you must know what to do,', + 'and then do your best', + '- W.Edwards Deming', ], - textStyle: TextStyle(fontSize: 30.0, fontFamily: "Bobbers"), + textStyle: TextStyle(fontSize: 30.0, fontFamily: 'Bobbers'), ), ), SizedBox( width: 250.0, child: TypewriterAnimatedTextKit( onTap: () { - print("Tap Event"); + print('Tap Event'); }, text: [ - "Discipline is the best tool", - "Design first, then code", - "Do not patch bugs out, rewrite them", - "Do not test bugs out, design them out", + 'Discipline is the best tool', + 'Design first, then code', + 'Do not patch bugs out, rewrite them', + 'Do not test bugs out, design them out', ], - textStyle: TextStyle(fontSize: 30.0, fontFamily: "Agne"), + textStyle: TextStyle(fontSize: 30.0, fontFamily: 'Agne'), ), ), ScaleAnimatedTextKit( onTap: () { - print("Tap Event"); + print('Tap Event'); }, - text: ["Think", "Build", "Ship"], - textStyle: TextStyle(fontSize: 70.0, fontFamily: "Canterbury"), + text: ['Think', 'Build', 'Ship'], + textStyle: TextStyle(fontSize: 70.0, fontFamily: 'Canterbury'), ), /// colors.length >= 2 ColorizeAnimatedTextKit( onTap: () { - print("Tap Event"); + print('Tap Event'); }, text: [ - "Larry Page", - "Bill Gates", - "Steve Jobs", + 'Larry Page', + 'Bill Gates', + 'Steve Jobs', ], - textStyle: TextStyle(fontSize: 50.0, fontFamily: "Horizon"), + textStyle: TextStyle(fontSize: 50.0, fontFamily: 'Horizon'), colors: [ Colors.purple, Colors.blue, @@ -157,14 +157,14 @@ class _MyHomePageState extends State { WavyAnimatedTextKit( textStyle: TextStyle(fontSize: 20), text: [ - "Hello World", - "Look at the waves", - "They look so Amazing", + 'Hello World', + 'Look at the waves', + 'They look so Amazing', ], ), ]; - List _colors = [ + final _colors = [ Colors.orange[800], Colors.brown[600], Colors.lightGreen[800], diff --git a/example/pubspec.yaml b/example/pubspec.yaml index f47c4b6..38f5c10 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -12,9 +12,9 @@ dev_dependencies: sdk: flutter animated_text_kit: path: ../ + pedantic: ^1.9.2 flutter: - uses-material-design: true assets: diff --git a/lib/src/colorize.dart b/lib/src/colorize.dart index 9cf612e..3d76511 100644 --- a/lib/src/colorize.dart +++ b/lib/src/colorize.dart @@ -225,7 +225,7 @@ class _ColorizeTextState extends State ), )..addStatusListener(_animationEndCallback); - _controller?.forward(); + _controller.forward(); } void _animationEndCallback(state) { diff --git a/lib/src/wavy.dart b/lib/src/wavy.dart index f1854a3..917df38 100644 --- a/lib/src/wavy.dart +++ b/lib/src/wavy.dart @@ -119,7 +119,7 @@ class _WavyAnimatedTextKitState extends State ); } - Future _nextAnimation() async { + void _nextAnimation() { final isLast = _index == widget.text.length - 1; // Handling onNext callback diff --git a/pubspec.yaml b/pubspec.yaml index 12084b6..f309f9d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -13,6 +13,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter + pedantic: ^1.9.2 flutter: diff --git a/test/smoke_test.dart b/test/smoke_test.dart index aadcf14..7bed99e 100644 --- a/test/smoke_test.dart +++ b/test/smoke_test.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; +// ignore: avoid_relative_lib_imports import '../example/lib/main.dart'; void main() {