push autoamtion api connect

This commit is contained in:
ashrafzarkanisala
2024-07-24 01:41:10 +03:00
parent 9a088353e0
commit 7a773f1653
20 changed files with 874 additions and 272 deletions

View File

@ -0,0 +1,17 @@
import 'package:flutter/material.dart';
void navigateToRoute(BuildContext context, String targetRoute) {
bool routeFound = false;
Navigator.popUntil(context, (route) {
if (route.settings.name == targetRoute) {
routeFound = true;
return true;
}
return route.isFirst;
});
if (!routeFound) {
Navigator.pushNamed(context, targetRoute);
}
}