Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added pedantic lint rules. #132

Merged
merged 6 commits into from
Oct 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include: package:pedantic/analysis_options.yaml
78 changes: 39 additions & 39 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import 'package:animated_text_kit/animated_text_kit.dart';
void main() => runApp(MyApp());

const List<String> labels = [
"Rotate",
"Fade",
"Typer",
"Typewriter",
"Scale",
"Colorize",
"TextLiquidFill",
"Wavy Text"
'Rotate',
'Fade',
'Typer',
'Typewriter',
'Scale',
'Colorize',
'TextLiquidFill',
'Wavy Text'
];

class MyApp extends StatefulWidget {
Expand Down Expand Up @@ -47,7 +47,7 @@ class MyHomePage extends StatefulWidget {
}

class _MyHomePageState extends State<MyHomePage> {
List<Widget> _textAnimationKit = [
final _textAnimationKit = <Widget>[
ListView(
scrollDirection: Axis.horizontal,
children: <Widget>[
Expand All @@ -59,7 +59,7 @@ class _MyHomePageState extends State<MyHomePage> {
height: 100.0,
),
Text(
"Be",
'Be',
style: TextStyle(fontSize: 43.0),
),
SizedBox(
Expand All @@ -68,74 +68,74 @@ class _MyHomePageState extends State<MyHomePage> {
),
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'),
),
],
),
],
),
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,
Expand All @@ -157,14 +157,14 @@ class _MyHomePageState extends State<MyHomePage> {
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<Color> _colors = [
final _colors = <Color>[
Colors.orange[800],
Colors.brown[600],
Colors.lightGreen[800],
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ dev_dependencies:
sdk: flutter
animated_text_kit:
path: ../
pedantic: ^1.9.2

flutter:

uses-material-design: true

assets:
Expand Down
2 changes: 1 addition & 1 deletion lib/src/colorize.dart
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ class _ColorizeTextState extends State<ColorizeAnimatedTextKit>
),
)..addStatusListener(_animationEndCallback);

_controller?.forward();
_controller.forward();
}

void _animationEndCallback(state) {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/wavy.dart
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class _WavyAnimatedTextKitState extends State<WavyAnimatedTextKit>
);
}

Future<void> _nextAnimation() async {
void _nextAnimation() {
final isLast = _index == widget.text.length - 1;

// Handling onNext callback
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
pedantic: ^1.9.2

flutter:

Expand Down
1 change: 1 addition & 0 deletions test/smoke_test.dart
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down