tap_animation_kit 1.0.0 copy "tap_animation_kit: ^1.0.0" to clipboard
tap_animation_kit: ^1.0.0 copied to clipboard

Animation kit as a Flutter pakage. It contains some common animaiton like opacity, padding, crossfade, alignment, align transition etc.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:tap_animation_kit/tap_animation_kit.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    return _MyAppState();
  }
}

class _MyAppState extends State<MyApp> with SingleTickerProviderStateMixin {
  AlignmentGeometryTween alignTransition;
  AnimationController controller;
  Animation<double> animation;

  @override
  void initState() {
    super.initState();
    controller =
        AnimationController(vsync: this, duration: const Duration(seconds: 3));
    alignTransition = AlignmentGeometryTween(
      begin: Alignment.bottomLeft,
      end: Alignment.topCenter,
    );
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Tap Animation Kit'),
        ),
        body: Center(
          child: Container(
            height: 120,
            width: 120,
            color: Colors.green,
            child: TextAnimation(
              animationBahavior: TapAlignTransition(
                props: AlignTransitionModel(
                  alignment: alignTransition.animate(controller),
                  child: const Text(
                    'AT',
                    style: TextStyle(fontSize: 20, color: Colors.white),
                  ),
                ),
              ),
            ),
          ),
        ),
        floatingActionButton: FloatingActionButton(
          child: const Icon(Icons.touch_app),
          onPressed: () {
            setState(() {
              alignTransition = alignTransition.end == Alignment.bottomRight
                  ? AlignmentGeometryTween(
                      begin: Alignment.bottomLeft,
                      end: Alignment.topCenter,
                    )
                  : AlignmentGeometryTween(
                      begin: Alignment.topCenter,
                      end: Alignment.bottomRight,
                    );
            });

            controller.repeat();
          },
        ),
      ),
    );
  }
}
1
likes
30
pub points
8%
popularity

Publisher

unverified uploader

Animation kit as a Flutter pakage. It contains some common animaiton like opacity, padding, crossfade, alignment, align transition etc.

Repository (GitHub)
View/report issues

License

BSD-3-Clause (LICENSE)

Dependencies

flutter

More

Packages that depend on tap_animation_kit