showSafaehAnchored<T> function
Future<T?>
showSafaehAnchored<T>({
- required BuildContext context,
- Widget? child,
- Widget childBuilder(
- BuildContext context,
- double progress
- SafaehAnchoredMotion motion = SafaehAnchoredMotion.drop,
- LayerLink? link,
- Rect? sourceRect,
- bool opensAbove = false,
- ShapeBorder sourceShape = const CircleBorder(),
- double maxCardWidth = 420,
- bool barrierDismissible = true,
Opens child from an anchor with motion.
Pass link so the card follows a live target. sourceRect places the
drop card and cuts the genie scrim hole. The host owns the card.
Implementation
Future<T?> showSafaehAnchored<T>({
required BuildContext context,
Widget? child,
Widget Function(BuildContext context, double progress)? childBuilder,
SafaehAnchoredMotion motion = SafaehAnchoredMotion.drop,
LayerLink? link,
Rect? sourceRect,
bool opensAbove = false,
ShapeBorder sourceShape = const CircleBorder(),
double maxCardWidth = 420,
bool barrierDismissible = true,
}) {
assert(child != null || childBuilder != null);
if (motion == SafaehAnchoredMotion.genie) SafaehGenieShader.preload();
final captured = sourceRect;
final barrierLabel = MaterialLocalizations.of(context).modalBarrierDismissLabel;
return Navigator.of(context, rootNavigator: true).push<T>(
_AnchoredRoute<T>(
motion: motion,
link: link,
sourceRect: captured,
opensAbove: opensAbove,
sourceShape: sourceShape,
maxCardWidth: maxCardWidth,
dismissible: barrierDismissible,
barrierLabel: barrierLabel,
child: child,
childBuilder: childBuilder,
),
);
}