pushWithRippleEffect<T> static method

Future<T?> pushWithRippleEffect<T>(
  1. Widget? screen, {
  2. BuildContext? context,
  3. AlignmentGeometry centerAlignment = Alignment.bottomRight,
  4. Offset centerOffset = const Offset(10, 10),
})

Push screen with Ripple Effect (Default: bottomRight to topLeft, You can change the alignment and offset)

If you provide context, you can nest navigate in your specific context

Implementation

static Future<T?> pushWithRippleEffect<T>(Widget? screen,
    {BuildContext? context,
    AlignmentGeometry centerAlignment = Alignment.bottomRight,
    Offset centerOffset = const Offset(10, 10)}) async {
  if (screen == null) {
    return null;
  }
  if (height == null && navigatorState(context) != null) {
    initDeviceSize(navigatorState(context)!.context);
  }

  return navigatorState(context)?.push(
    RoundRevealRoute(
      screen,
      maxRadius: height! + width / 2,
      centerAlignment: centerAlignment,
      centerOffset: centerOffset,
      minRadius: 10,
    ),
  );
}