handleHero method
Handles convenience 'hero' property.
Implementation
@protected
Widget handleHero(BuildContext context, Widget widget, WidgetNodeSpec spec) {
if (spec.props["heroTag"] != null) {
final hero = Hero(
tag: spec.props["heroTag"],
child: Material(type: MaterialType.transparency, child: widget));
if (widget is PreferredSizeWidget) {
widget = PreferredSize(
preferredSize: Size.fromHeight(widget.preferredSize.height),
child: hero,
);
} else {
widget = hero;
}
}
return widget;
}