Skip to content

Commit

Permalink
Versión 3.1.2 - Dart Format .
Browse files Browse the repository at this point in the history
  • Loading branch information
Klerith committed Sep 7, 2023
1 parent 45ed44b commit 628b20f
Show file tree
Hide file tree
Showing 12 changed files with 110 additions and 55 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#### [3.1.2] - New Docs
* Dart format .

#### [3.1.1] - New Docs
* Typo Readme

Expand Down
2 changes: 1 addition & 1 deletion lib/animate_do.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ library animate_do;

/// Author: Fernando Herrera
/// website: fernando-herrera.com
/// Version: 2.1.0
/// Version: 3.2.0
/// Null-Safety: checked!
/// Prefer Const: checked!
Expand Down
54 changes: 33 additions & 21 deletions lib/src/animate_do_attention_seekers.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'dart:math' show pi, sin;
import 'package:flutter/material.dart';


/// Class [Bounce]:
/// [key]: optional widget key reference
/// [child]: mandatory, widget to animate
Expand Down Expand Up @@ -88,7 +87,9 @@ class BounceState extends State<Bounce> with SingleTickerProviderStateMixin {

@override
Widget build(BuildContext context) {
if (widget.animate && widget.delay.inMilliseconds == 0 && widget.manualTrigger == false ) {
if (widget.animate &&
widget.delay.inMilliseconds == 0 &&
widget.manualTrigger == false) {
(widget.infinite) ? controller.repeat() : controller.forward();
}

Expand Down Expand Up @@ -195,7 +196,9 @@ class FlashState extends State<Flash> with SingleTickerProviderStateMixin {

@override
Widget build(BuildContext context) {
if (widget.animate && widget.delay.inMilliseconds == 0 && widget.manualTrigger == false ) {
if (widget.animate &&
widget.delay.inMilliseconds == 0 &&
widget.manualTrigger == false) {
(widget.infinite) ? controller.repeat() : controller.forward();
}

Expand Down Expand Up @@ -301,7 +304,9 @@ class PulseState extends State<Pulse> with SingleTickerProviderStateMixin {

@override
Widget build(BuildContext context) {
if (widget.animate && widget.delay.inMilliseconds == 0 && widget.manualTrigger == false ) {
if (widget.animate &&
widget.delay.inMilliseconds == 0 &&
widget.manualTrigger == false) {
(widget.infinite) ? controller.repeat() : controller.forward();
}

Expand Down Expand Up @@ -430,7 +435,9 @@ class SwingState extends State<Swing> with SingleTickerProviderStateMixin {

@override
Widget build(BuildContext context) {
if (widget.animate && widget.delay.inMilliseconds == 0 && widget.manualTrigger == false ) {
if (widget.animate &&
widget.delay.inMilliseconds == 0 &&
widget.manualTrigger == false) {
(widget.infinite) ? controller.repeat() : controller.forward();
}

Expand Down Expand Up @@ -541,7 +548,9 @@ class SpinState extends State<Spin> with SingleTickerProviderStateMixin {

@override
Widget build(BuildContext context) {
if (widget.animate && widget.delay.inMilliseconds == 0 && widget.manualTrigger == false ) {
if (widget.animate &&
widget.delay.inMilliseconds == 0 &&
widget.manualTrigger == false) {
(widget.infinite) ? controller.repeat() : controller.forward();
}

Expand Down Expand Up @@ -640,7 +649,9 @@ class SpinPerfectState extends State<SpinPerfect>

@override
Widget build(BuildContext context) {
if (widget.animate && widget.delay.inMilliseconds == 0 && widget.manualTrigger == false ) {
if (widget.animate &&
widget.delay.inMilliseconds == 0 &&
widget.manualTrigger == false) {
(widget.infinite) ? controller.repeat() : controller.forward();
}

Expand Down Expand Up @@ -747,7 +758,9 @@ class DanceState extends State<Dance> with SingleTickerProviderStateMixin {

@override
Widget build(BuildContext context) {
if (widget.animate && widget.delay.inMilliseconds == 0 && widget.manualTrigger == false ) {
if (widget.animate &&
widget.delay.inMilliseconds == 0 &&
widget.manualTrigger == false) {
(widget.infinite) ? controller.repeat() : controller.forward();
}

Expand Down Expand Up @@ -834,8 +847,8 @@ class RouletteState extends State<Roulette>

controller = AnimationController(duration: widget.duration, vsync: this);

spin = Tween<double>(begin: 0, end: widget.spins * 2).animate(
CurvedAnimation(parent: controller, curve: Curves.elasticOut));
spin = Tween<double>(begin: 0, end: widget.spins * 2)
.animate(CurvedAnimation(parent: controller, curve: Curves.elasticOut));

if (!widget.manualTrigger && widget.animate) {
Future.delayed(widget.delay, () {
Expand All @@ -852,7 +865,9 @@ class RouletteState extends State<Roulette>

@override
Widget build(BuildContext context) {
if (widget.animate && widget.delay.inMilliseconds == 0 && widget.manualTrigger == false ) {
if (widget.animate &&
widget.delay.inMilliseconds == 0 &&
widget.manualTrigger == false) {
(widget.infinite) ? controller.repeat() : controller.forward();
}

Expand Down Expand Up @@ -900,7 +915,7 @@ class ShakeX extends StatefulWidget {
this.controller,
this.manualTrigger = false,
this.animate = true,
this.from = 10 })
this.from = 10})
: super(key: key) {
if (manualTrigger == true && controller == null) {
throw FlutterError('If you want to use manualTrigger:true, \n\n'
Expand All @@ -916,7 +931,6 @@ class ShakeX extends StatefulWidget {
/// State class,
/// Controls the animations flow
class ShakeXState extends State<ShakeX> with SingleTickerProviderStateMixin {

late AnimationController controller;
bool disposed = false;

Expand All @@ -934,7 +948,6 @@ class ShakeXState extends State<ShakeX> with SingleTickerProviderStateMixin {
controller = AnimationController(duration: widget.duration, vsync: this);

if (!widget.manualTrigger && widget.animate) {

Future.delayed(widget.delay, () {
if (!disposed) {
(widget.infinite) ? controller.repeat() : controller.forward();
Expand All @@ -949,7 +962,9 @@ class ShakeXState extends State<ShakeX> with SingleTickerProviderStateMixin {

@override
Widget build(BuildContext context) {
if (widget.animate && widget.delay.inMilliseconds == 0 && widget.manualTrigger == false ) {
if (widget.animate &&
widget.delay.inMilliseconds == 0 &&
widget.manualTrigger == false) {
(widget.infinite) ? controller.repeat() : controller.forward();
}

Expand All @@ -969,8 +984,6 @@ class ShakeXState extends State<ShakeX> with SingleTickerProviderStateMixin {
}
}



/// Class [ShakeY]:
/// [key]: optional widget key reference
/// [child]: mandatory, widget to animate
Expand Down Expand Up @@ -1015,7 +1028,6 @@ class ShakeY extends StatefulWidget {
/// State class,
/// Controls the animations flow
class ShakeYState extends State<ShakeY> with SingleTickerProviderStateMixin {

late AnimationController controller;
bool disposed = false;

Expand All @@ -1033,7 +1045,6 @@ class ShakeYState extends State<ShakeY> with SingleTickerProviderStateMixin {
controller = AnimationController(duration: widget.duration, vsync: this);

if (!widget.manualTrigger && widget.animate) {

Future.delayed(widget.delay, () {
if (!disposed) {
(widget.infinite) ? controller.repeat() : controller.forward();
Expand All @@ -1048,7 +1059,9 @@ class ShakeYState extends State<ShakeY> with SingleTickerProviderStateMixin {

@override
Widget build(BuildContext context) {
if (widget.animate && widget.delay.inMilliseconds == 0 && widget.manualTrigger == false ) {
if (widget.animate &&
widget.delay.inMilliseconds == 0 &&
widget.manualTrigger == false) {
(widget.infinite) ? controller.repeat() : controller.forward();
}

Expand All @@ -1067,4 +1080,3 @@ class ShakeYState extends State<ShakeY> with SingleTickerProviderStateMixin {
});
}
}

8 changes: 6 additions & 2 deletions lib/src/animate_do_bounces.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ class BounceInDownState extends State<BounceInDown>

@override
Widget build(BuildContext context) {
if (widget.animate && widget.delay.inMilliseconds == 0 && widget.manualTrigger == false ) {
if (widget.animate &&
widget.delay.inMilliseconds == 0 &&
widget.manualTrigger == false) {
controller.forward();
}

Expand Down Expand Up @@ -220,7 +222,9 @@ class BounceInLeftState extends State<BounceInLeft>

@override
Widget build(BuildContext context) {
if (widget.animate && widget.delay.inMilliseconds == 0 && widget.manualTrigger == false ) {
if (widget.animate &&
widget.delay.inMilliseconds == 0 &&
widget.manualTrigger == false) {
controller.forward();
}

Expand Down
16 changes: 11 additions & 5 deletions lib/src/animate_do_elastics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ class ElasticInState extends State<ElasticIn>
opacity = Tween<double>(begin: 0, end: 1).animate(
CurvedAnimation(parent: controller, curve: const Interval(0, 0.45)));

bouncing = Tween<double>(begin: 0, end: 1).animate(
CurvedAnimation(parent: controller, curve: Curves.elasticOut));
bouncing = Tween<double>(begin: 0, end: 1)
.animate(CurvedAnimation(parent: controller, curve: Curves.elasticOut));

if (!widget.manualTrigger && widget.animate) {
Future.delayed(widget.delay, () {
Expand All @@ -76,7 +76,9 @@ class ElasticInState extends State<ElasticIn>

@override
Widget build(BuildContext context) {
if (widget.animate && widget.delay.inMilliseconds == 0 && widget.manualTrigger == false ) {
if (widget.animate &&
widget.delay.inMilliseconds == 0 &&
widget.manualTrigger == false) {
controller.forward();
}

Expand Down Expand Up @@ -187,7 +189,9 @@ class ElasticInDownState extends State<ElasticInDown>

@override
Widget build(BuildContext context) {
if (widget.animate && widget.delay.inMilliseconds == 0 && widget.manualTrigger == false ) {
if (widget.animate &&
widget.delay.inMilliseconds == 0 &&
widget.manualTrigger == false) {
controller.forward();
}

Expand Down Expand Up @@ -347,7 +351,9 @@ class ElasticInLeftState extends State<ElasticInLeft>

@override
Widget build(BuildContext context) {
if (widget.animate && widget.delay.inMilliseconds == 0 && widget.manualTrigger == false ) {
if (widget.animate &&
widget.delay.inMilliseconds == 0 &&
widget.manualTrigger == false) {
controller.forward();
}

Expand Down
24 changes: 16 additions & 8 deletions lib/src/animate_do_fadeouts.dart
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,14 @@ class FadeOutState extends State<FadeOut> with SingleTickerProviderStateMixin {

@override
Widget build(BuildContext context) {
if (widget.animate && widget.delay.inMilliseconds == 0 && widget.manualTrigger == false ) {
if (widget.animate &&
widget.delay.inMilliseconds == 0 &&
widget.manualTrigger == false) {
controller.forward();
}

/// If FALSE, animate everything back to original
if( !widget.animate ) {
if (!widget.animate) {
controller.animateBack(0);
}

Expand Down Expand Up @@ -170,12 +172,14 @@ class FadeOutDownState extends State<FadeOutDown>

@override
Widget build(BuildContext context) {
if (widget.animate && widget.delay.inMilliseconds == 0 && widget.manualTrigger == false ) {
if (widget.animate &&
widget.delay.inMilliseconds == 0 &&
widget.manualTrigger == false) {
controller.forward();
}

/// If FALSE, animate everything back to original
if( !widget.animate ) {
if (!widget.animate) {
controller.animateBack(0);
}

Expand Down Expand Up @@ -314,12 +318,14 @@ class FadeOutUpState extends State<FadeOutUp>

@override
Widget build(BuildContext context) {
if (widget.animate && widget.delay.inMilliseconds == 0 && widget.manualTrigger == false ) {
if (widget.animate &&
widget.delay.inMilliseconds == 0 &&
widget.manualTrigger == false) {
controller.forward();
}

/// If FALSE, animate everything back to original
if( !widget.animate ) {
if (!widget.animate) {
controller.animateBack(0);
}

Expand Down Expand Up @@ -458,12 +464,14 @@ class FadeOutLeftState extends State<FadeOutLeft>

@override
Widget build(BuildContext context) {
if (widget.animate && widget.delay.inMilliseconds == 0 && widget.manualTrigger == false ) {
if (widget.animate &&
widget.delay.inMilliseconds == 0 &&
widget.manualTrigger == false) {
controller.forward();
}

/// If FALSE, animate everything back to original
if( !widget.animate ) {
if (!widget.animate) {
controller.animateBack(0);
}

Expand Down
Loading

0 comments on commit 628b20f

Please sign in to comment.