mationani 0.0.47 copy "mationani: ^0.0.47" to clipboard
mationani: ^0.0.47 copied to clipboard

create animation by stateless widget

example/mationani_example.dart

// ignore_for_file: unused_import
import 'dart:developer';
import 'dart:math' as math;

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

import 'samples/draw_each.dart';
import 'samples/cutting_respectively.dart';
import 'samples/cabinet_selected.dart';
import 'samples/slide_sequence.dart';

void main(List<String> args) {
  runApp(const MyApp());
}

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: true,
      home: const MyHome(),
      // home: const OldWay(),
    );
  }
}

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

  @override
  State<MyHome> createState() => _MyHomeState();
}

class _MyHomeState extends State<MyHome> {
  bool toggle = false;
  int step = 0;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.black45,
      body: Align(
        alignment: const Alignment(-0.2, 1),
        child: Padding(
          padding: const EdgeInsetsGeometry.only(bottom: 80),
          child: SizedBox(
            height: 300,
            width: 100,
            child: SampleSlide(),
            // child: SampleDraw(),
            // child: SampleCutting(),
            // child: SampleCabinet(toggle: toggle),
          ),
        ),
      ),
      floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
      floatingActionButton: Builder(
        builder: (context) => FloatingActionButton(
          onPressed: () {
            setState(() {
              toggle = !toggle;
              step++;
            });
            ScaffoldMessenger.of(context).showSnackBar(SnackBar(
              // content: Center(child: Text('toggle: $toggle')),
              content: Center(child: Text('step: $step')),
              duration: Duration(milliseconds: 200),
            ));
          },
        ),
      ),
    );
  }
}
2
likes
140
points
1.12k
downloads

Publisher

unverified uploader

Weekly Downloads

create animation by stateless widget

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, vector_math

More

Packages that depend on mationani