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

Hero-animates it's child from one layout position to another within the same Route.

example/lib/main.dart

import 'package:example/cup_game/cup_game_page.dart';
import 'package:example/flight_state_demo/flight_state_demo_page.dart';
import 'package:example/core/adaptive.dart';
import 'package:example/core/app_theme.dart';
import 'package:flutter/material.dart';
import 'package:hero_animation/hero_animation.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return HeroAnimationTheme(
      duration: const Duration(milliseconds: 750),
      curve: Curves.easeOutCubic,
      child: MaterialApp(
        home: Builder(builder: (context) {
          return AppThemeProvider(
            theme: isDisplayDesktop(context)
                ? AppTheme.desktop()
                : AppTheme.mobile(),
            child: DefaultTabController(
              length: 2,
              child: Builder(builder: (context) {
                return Scaffold(
                  appBar: AppBar(
                    title: TabBar(
                      tabs: <Widget>[
                        Container(
                            alignment: Alignment.center,
                            height: 55,
                            child: const Text('Flight state usage')),
                        Container(
                            alignment: Alignment.center,
                            height: 55,
                            child: const Text('Cup Game')),
                      ],
                    ),
                  ),
                  body: const TabBarView(
                    children: <Widget>[
                      FlightStateDemoPage(),
                      CupGamePage(),
                    ],
                  ),
                );
              }),
            ),
          );
        }),
      ),
    );
  }
}
63
likes
0
pub points
85%
popularity

Publisher

verified publisherkirn.tech

Hero-animates it's child from one layout position to another within the same Route.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on hero_animation