animate_z_widget 0.0.8 copy "animate_z_widget: ^0.0.8" to clipboard
animate_z_widget: ^0.0.8 copied to clipboard

AnimateZ is a Flutter package that allows you to add various animations to your widgets with ease.

example/lib/main.dart

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

void main() {
  runApp(const MainApp());
}

class MainApp extends StatelessWidget {
  const MainApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: SplashScreen(),
    );
  }
}

class SplashScreen extends StatefulWidget {
  const SplashScreen({super.key});

  @override
  State<SplashScreen> createState() => _SplashScreenState();
}

class _SplashScreenState extends State<SplashScreen> {
  AnimationType _animationType = AnimationType.rotate;
  @override
  Widget build(BuildContext context) {
    Future.delayed(const Duration(seconds: 10)).then((_) {
      Navigator.of(context).pushReplacement(
          MaterialPageRoute(builder: (context) => const HomeScreen()));
    });
    return Scaffold(
      body: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          Center(
            child: AnimateZWidget(
              animationType: _animationType,
              animate: true,
              child: const FlutterLogo(
                size: 50,
              ),
            ),
          ),
          TextButton(
              onPressed: () {
                setState(() {
                  _animationType = AnimationType.rotate;
                });
              },
              child: const Text("Rotation Animation")),
          TextButton(
              onPressed: () {
                setState(() {
                  _animationType = AnimationType.flip;
                });
              },
              child: const Text("Flip Animation")),
          TextButton(
              onPressed: () {
                setState(() {
                  _animationType = AnimationType.scale;
                });
              },
              child: const Text("Scale Animation")),
        ],
      ),
    );
  }
}

class HomeScreen extends StatelessWidget {
  const HomeScreen({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const AnimateZWidget(
          animate: false,
          child: FlutterLogo(
            size: 20,
          ),
        ),
      ),
    );
  }
}
2
likes
160
points
59
downloads

Publisher

verified publishertamerelzein.com

Weekly Downloads

AnimateZ is a Flutter package that allows you to add various animations to your widgets with ease.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on animate_z_widget