phased 0.0.3 copy "phased: ^0.0.3" to clipboard
phased: ^0.0.3 copied to clipboard

Simplified state management focused on animations

example/lib/main.dart

import 'package:example/blink.dart';
import 'package:example/complex_animation.dart';
import 'package:flutter/material.dart';
import 'package:phased/phased.dart';

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

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

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    final manualState = PhasedState(
      values: [true, false],
      autostart: false,
    );
    return MaterialApp(
      home: Scaffold(
        body: SingleChildScrollView(
          child: SafeArea(
            child: Center(
              child: Column(
                children: [
                  const Text('Autostart'),
                  Blink(
                    state: BlinkState(),
                    child: Container(
                      width: 100,
                      height: 100,
                      color: Colors.blue,
                    ),
                  ),
                  const Divider(),
                  const Text('Manual'),
                  ElevatedButton(
                    onPressed: () {
                      manualState.start();
                    },
                    child: const Text('Start'),
                  ),
                  Blink(
                    state: manualState,
                    child: Container(
                      width: 100,
                      height: 100,
                      color: Colors.blue,
                    ),
                  ),
                  const Divider(),
                  const SizedBox(height: 100),
                  const ComplexAnimation(),
                ],
              ),
            ),
          ),
        ),
      ),
    );
  }
}
5
likes
150
pub points
35%
popularity

Publisher

unverified uploader

Simplified state management focused on animations

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on phased