push<T extends ChangeNotifier> function Null safety

Future push<T extends ChangeNotifier>(
  1. Widget screen,
  2. [T? provider]
)

Implementation

Future<dynamic> push<T extends ChangeNotifier>(
  Widget screen, [
  T? provider,
]) async {
  return Navigator.of(Get.context!).push(
    MaterialPageRoute(
      builder: (_) {
        return provider != null
            ? ChangeNotifierProvider(create: (_) => provider, child: screen)
            : screen;
      },
    ),
  );
}