switch from query paramater to path paramater for profile views

This commit is contained in:
2026-06-01 14:14:56 +02:00
parent efe225b9f8
commit 93942ff060
7 changed files with 51 additions and 15 deletions
+24 -3
View File
@@ -164,9 +164,20 @@ class MihGoRouter {
path: MihGoRouterPaths.mzansiProfileView,
builder: (BuildContext context, GoRouterState state) {
KenLogger.success("MihGoRouter: mzansiProfileView");
String? username = state.uri.queryParameters['username'];
KenLogger.success("username: username");
return MzansiProfileView(
username: null,
);
},
),
GoRoute(
name: "mzansiProfileView+username",
path: "${MihGoRouterPaths.mzansiProfileView}/:username",
builder: (BuildContext context, GoRouterState state) {
KenLogger.success("MihGoRouter: mzansiProfileView");
String? username = state.pathParameters['username'];
// String? username = state.uri.queryParameters['username'];
KenLogger.success("MihGoRouter: mzansiProfileView");
KenLogger.success("username: $username");
MzansiDirectoryProvider directoryProvider =
context.read<MzansiDirectoryProvider>();
if (directoryProvider.selectedUser == null && username == null) {
@@ -192,9 +203,19 @@ class MihGoRouter {
GoRoute(
name: "businessProfileView",
path: MihGoRouterPaths.businessProfileView,
builder: (BuildContext context, GoRouterState state) {
return MzansiBusinessProfileView(
businessId: null,
fromMzansiDirectory: true,
);
},
),
GoRoute(
name: "businessProfileView+business_id",
path: "${MihGoRouterPaths.businessProfileView}/:business_id",
builder: (BuildContext context, GoRouterState state) {
// KenLogger.success("MihGoRouter: businessProfileView");
String? businessId = state.uri.queryParameters['business_id'];
String? businessId = state.pathParameters['business_id'];
// KenLogger.success("businessId: $businessId");
MzansiDirectoryProvider directoryProvider =
context.read<MzansiDirectoryProvider>();