motion_widget 1.0.2 copy "motion_widget: ^1.0.2" to clipboard
motion_widget: ^1.0.2 copied to clipboard

A simple, powerful widget to build cool transitions. It handles initialization, state changes, code clean-ups and all the other animation boilerplate code, keeping you in the driver's seat by allowing [...]

example/example.dart

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

class SplashScreen extends StatefulWidget {
  @override
  _SplashScreenState createState() => _SplashScreenState();
}

class _SplashScreenState extends State<SplashScreen> {
  MotionExitConfigurations motionExitConfigurations;

  @override
  void initState() {
    super.initState();

    motionExitConfigurations =
        MotionExitConfigurations(durationMs: 500, displacement: 50);

    Future.delayed(Duration(seconds: 2), () {
      motionExitConfigurations.controller.addStatusListener((status) {
        if (status == AnimationStatus.completed)
          Navigator.pushReplacement(context,
              PageRouteBuilder(pageBuilder: (_, __, ___) => SplashScreen()));
      });
      motionExitConfigurations.controller.forward();
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        body: Center(
            child: Motion<Row>(
              mainAxisSize: MainAxisSize.min,
              exitConfigurations: motionExitConfigurations,
              children: <Widget>[
                MotionElement(
                  child: Text(
                    "Introducing\nMotion Widget",
                    textAlign: TextAlign.center,
                    style: TextStyle(fontWeight: FontWeight.bold, fontSize: 25),
                  ),
                  orientation: MotionOrientation.RIGHT,
                  interval: Interval(0.0, 0.5),
                ),
                SizedBox(
                  width: 20,
                ),
                MotionElement(
                  child: FlutterLogo(size: 50),
                  interval: Interval(0.5, 1.0, curve: Curves.easeOutBack),
                )
              ],
            )));
  }
}
65
likes
20
pub points
34%
popularity

Publisher

unverified uploader

A simple, powerful widget to build cool transitions. It handles initialization, state changes, code clean-ups and all the other animation boilerplate code, keeping you in the driver's seat by allowing you control the animations at each interval.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on motion_widget