open<T extends Object> static method

Future<T?> open<T extends Object>({
  1. required BuildContext context,
  2. required Widget child,
  3. required bool forceFullPage,
  4. Color? backgroundColor,
})

Implementation

static Future<T?> open<T extends Object>({
  required BuildContext context,
  required Widget child,
  required bool forceFullPage,
  Color? backgroundColor,
}) async {
  if (ResponsiveComponent.isDesktop(context) && !forceFullPage) {
    return await showDialog<T>(
        context: context,
        builder: (context) {
          return OdinNavigatorPage(
            backgroundColor: backgroundColor,
            forceFullPage: forceFullPage,
            child: child,
          );
        });
  }
  return await Navigator.of(context)
      .push<T>(MaterialPageRoute(builder: (context) {
    return OdinNavigatorPage(
      backgroundColor: backgroundColor,
      forceFullPage: forceFullPage,
      child: child,
    );
  }));
}