transition method Null safety

Future<void> transition(
  1. BuildContext context,
  2. Widget target
)

Implementation

Future<void> transition(BuildContext context, Widget target) async {
  await Navigator.push(
    context,
    FadeRoute(page: target),
  );
}