import 'package:flutter/material.dart';

navigateWithName(BuildContext context, String routeName, {Object? arguments}) {
  Navigator.pushNamed(context, routeName, arguments: arguments);
}

Future<void> navigateReplaceWithName(BuildContext context, String routeName, {Object? arguments}) async {
  await Navigator.pushReplacementNamed(context, routeName, arguments: arguments);
}

navigateReplaceWithNameUntilRoute(BuildContext context, String routeName, {Object? arguments}) {
  Navigator.pushNamedAndRemoveUntil(context, routeName, (route) => false);
}

pop(BuildContext context) {
  Navigator.of(context).pop();
}

navigateTo(context, page) {
  Navigator.push(context, MaterialPageRoute(builder: (context) => page));
}
