mirror of
https://github.com/nostrlabs-io/zap-stream-flutter.git
synced 2025-06-15 19:48:23 +00:00
17
lib/app.dart
17
lib/app.dart
@ -76,7 +76,7 @@ void runZapStream() {
|
||||
if (state.extra is StreamEvent) {
|
||||
return StreamPage(stream: state.extra as StreamEvent);
|
||||
} else {
|
||||
throw UnimplementedError();
|
||||
return StreamPage.loader(state.pathParameters["id"]!);
|
||||
}
|
||||
},
|
||||
),
|
||||
@ -119,6 +119,21 @@ void runZapStream() {
|
||||
),
|
||||
],
|
||||
),
|
||||
GoRoute(
|
||||
path: "/:id",
|
||||
redirect: (context, state) {
|
||||
final id = state.pathParameters["id"]!;
|
||||
if (id.startsWith("naddr1") ||
|
||||
id.startsWith("nevent1") ||
|
||||
id.startsWith("note1")) {
|
||||
return "/e/$id";
|
||||
} else if (id.startsWith("npub1") ||
|
||||
id.startsWith("nprofile1")) {
|
||||
return "/p/$id";
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
|
Reference in New Issue
Block a user