0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[Flutter] flightShuttleBuilder使ってみた。

0
Posted at

皆様こんにちは! 
今回はHero Widgetのなかで、flightShuttleBuilderを使ってみました。
Heroを簡単に使うとしたら、Tagだけでも問題ないです。


typedef HeroFlightShuttleBuilder = Widget Function(
  BuildContext flightContext,
  Animation<double> animation,
  HeroFlightDirection flightDirection,
  BuildContext fromHeroContext,
  BuildContext toHeroContext,
);

Code

main.dart

return Hero(
      tag: 'hero-${element.symbol}',
      flightShuttleBuilder: (_, anim, __, ___, ____) => ScaleTransition(
            scale: anim.drive(Tween(begin: 1, end: 1.75)),
            child: tile,
      ),
      child: Transform.scale(
        scale: isLarge ? 1.75 : 1,
        child: tile,
    ),
);

image.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?