import 'package:flutter/material.dart';

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

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

navigateReplaceWithNameTillLast(BuildContext context, String routeName, {Object? arguments}) {
  Navigator.of(context)
      .pushNamedAndRemoveUntil(routeName, (Route<dynamic> route) => false,arguments: arguments);
}

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