Skip to content

Commit

Permalink
fix: url is missing / at the beginning
Browse files Browse the repository at this point in the history
  • Loading branch information
foxsofter committed Jun 4, 2024
1 parent ee4758b commit 56839c3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 4.15.2

- fix: url is missing / at the beginning

## 4.15.1

- fix: push with innerURL not working
Expand Down
15 changes: 10 additions & 5 deletions lib/src/navigator/navigator_route_settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,17 @@ extension NavigatorRouteSettings on RouteSettings {

String get url {
if (_urlOf[this] == null) {
var u = '';
final settingsName = name;
_urlOf[this] = settingsName == null ||
settingsName.isEmpty ||
!settingsName.contains(' ')
? ''
: settingsName.split(' ').last;
if (settingsName != null &&
settingsName.isNotEmpty &&
settingsName.contains(' ')) {
u = settingsName.split(' ').last;
// 补充 / 使其成为正常的 url
if (!u.startsWith('/')) {
_urlOf[this] = '/$u';
}
}
}
return _urlOf[this]!;
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_thrio
description: Thrio makes it easy and fast to add flutter to existing mobile applications, and provide a simple and consistent navigator APIs.
version: 4.15.1
version: 4.15.2
homepage: https://github.com/flutter-thrio/flutter_thrio

environment:
Expand Down

0 comments on commit 56839c3

Please sign in to comment.