This commit is contained in:
toly
2023-11-13 16:15:49 +08:00
parent 5396712cf9
commit 8de38299e2
57 changed files with 3039 additions and 156 deletions

View File

@@ -96,12 +96,14 @@ class AppRouterDelegate extends RouterDelegate<Object> with ChangeNotifier {
}
}
FutureOr<dynamic> changePath(
String value, {
bool forResult = false,
Object? extra,
bool keepAlive = false,
bool recordHistory = true,
bool recordHistory = false,
RouteStyle style = RouteStyle.replace,
}) {
return changeRoute(IRouteConfig(
@@ -158,12 +160,15 @@ class AppRouterDelegate extends RouterDelegate<Object> with ChangeNotifier {
if (iRoutes.isNotEmpty) {
for (int i = 0; i < iRoutes.length; i++) {
IRouteNode iroute = iRoutes[i];
config = config.copyWith(path: iroute.path);
IRouteConfig fixConfig = config;
if(iroute.path!=config.uri.path){
fixConfig = IRouteConfig(uri: Uri.parse(iroute.path));
}
Page? page;
if (iroute is NotFindNode) {
page = (notFindPageBuilder ?? _defaultNotFindPageBuilder)(context, config);
} else {
page = iroute.createPage(context, config);
page = iroute.createPage(context, fixConfig);
}
if (page != null) {
result.add(page);
@@ -199,7 +204,7 @@ class AppRouterDelegate extends RouterDelegate<Object> with ChangeNotifier {
_completerMap.remove(path);
}
if (_configs.isNotEmpty) {
if (canPop) {
_configs.removeLast();
notifyListeners();
} else {