Widget _flightShuttleBuilder(
BuildContext flightContext,
Animation<double> animation,
HeroFlightDirection flightDirection,
BuildContext fromHeroContext,
BuildContext toHeroContext,
) {
return DefaultTextStyle(
style: DefaultTextStyle.of(toHeroContext).style,
child: toHeroContext.widget,
);
}
...
Widget build(BuildContext context) {
return Scaffold(
...
child: Hero(
tag: 'text',
flightShuttleBuilder: _flightShuttleBuilder,
child: Text('Text'),
),