switch from query paramater to path paramater for profile views
This commit is contained in:
parent
efe225b9f8
commit
93942ff060
7 changed files with 51 additions and 15 deletions
|
|
@ -140,6 +140,7 @@ class _MihManageBusinessLinkWindowState
|
|||
),
|
||||
),
|
||||
child: ReorderableListView.builder(
|
||||
buildDefaultDragHandles: false,
|
||||
itemBuilder: (context, index) {
|
||||
ProfileLink link = profileProvider.businessLinks[index];
|
||||
String display = link.site_name;
|
||||
|
|
@ -149,7 +150,7 @@ class _MihManageBusinessLinkWindowState
|
|||
return ListTile(
|
||||
key: ValueKey("$index"),
|
||||
title: Text(
|
||||
"$display",
|
||||
display,
|
||||
style: TextStyle(
|
||||
// fontWeight: FontWeight.bold,
|
||||
fontSize: 18,
|
||||
|
|
@ -159,6 +160,13 @@ class _MihManageBusinessLinkWindowState
|
|||
profileProvider,
|
||||
link,
|
||||
),
|
||||
trailing: ReorderableDragStartListener(
|
||||
index: index,
|
||||
child: Icon(
|
||||
Icons.drag_indicator,
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
itemCount: profileProvider.businessLinks.length,
|
||||
|
|
|
|||
|
|
@ -59,7 +59,6 @@ class _MzansiBusinessProfileViewState extends State<MzansiBusinessProfileView> {
|
|||
super.initState();
|
||||
MzansiDirectoryProvider directoryProvider =
|
||||
context.read<MzansiDirectoryProvider>();
|
||||
directoryProvider.setBusinessViewIndex(0);
|
||||
_fetchBusinessDetails(directoryProvider);
|
||||
}
|
||||
|
||||
|
|
@ -77,7 +76,7 @@ class _MzansiBusinessProfileViewState extends State<MzansiBusinessProfileView> {
|
|||
);
|
||||
} else {
|
||||
return MihPackage(
|
||||
packageActionButton: getAction(),
|
||||
packageActionButton: getAction(directoryProvider),
|
||||
packageTools: getTools(),
|
||||
packageToolBodies: getToolBody(directoryProvider),
|
||||
packageToolTitles: getToolTitle(),
|
||||
|
|
@ -91,7 +90,7 @@ class _MzansiBusinessProfileViewState extends State<MzansiBusinessProfileView> {
|
|||
);
|
||||
}
|
||||
|
||||
MihPackageAction getAction() {
|
||||
MihPackageAction getAction(MzansiDirectoryProvider directoryProvider) {
|
||||
return MihPackageAction(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
iconColor: MihColors.secondary(),
|
||||
|
|
@ -107,6 +106,7 @@ class _MzansiBusinessProfileViewState extends State<MzansiBusinessProfileView> {
|
|||
// context.goNamed(
|
||||
// "mzansiDirectory",
|
||||
// );
|
||||
directoryProvider.setBusinessViewIndex(0);
|
||||
FocusScope.of(context).unfocus();
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -325,8 +325,7 @@ class _MihBusinessQrCodeState extends State<MihBusinessQrCode> {
|
|||
}
|
||||
_checkUserSession();
|
||||
futureImageUrl = MihFileApi.getMinioFileUrl(business.logo_path);
|
||||
qrCodedata =
|
||||
"${AppEnviroment.baseAppUrl}/business-profile/view?business_id=";
|
||||
qrCodedata = "${AppEnviroment.baseAppUrl}/business-profile/view/";
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_markdown_plus/flutter_markdown_plus.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_objects/profile_link.dart';
|
||||
|
|
@ -138,6 +139,7 @@ class _MihManageUserProfileLinksWindowState
|
|||
),
|
||||
),
|
||||
child: ReorderableListView.builder(
|
||||
buildDefaultDragHandles: false,
|
||||
itemBuilder: (context, index) {
|
||||
ProfileLink link = profileProvider.personalLinks[index];
|
||||
String display = link.site_name;
|
||||
|
|
@ -147,7 +149,7 @@ class _MihManageUserProfileLinksWindowState
|
|||
return ListTile(
|
||||
key: ValueKey("$index"),
|
||||
title: Text(
|
||||
"$display",
|
||||
display,
|
||||
style: TextStyle(
|
||||
// fontWeight: FontWeight.bold,
|
||||
fontSize: 18,
|
||||
|
|
@ -157,6 +159,13 @@ class _MihManageUserProfileLinksWindowState
|
|||
profileProvider,
|
||||
link,
|
||||
),
|
||||
trailing: ReorderableDragStartListener(
|
||||
index: index,
|
||||
child: Icon(
|
||||
Icons.drag_indicator,
|
||||
color: MihColors.secondary(),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
itemCount: profileProvider.personalLinks.length,
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@ class _MzansiProfileViewState extends State<MzansiProfileView> {
|
|||
void _loadUserData() async {
|
||||
MzansiDirectoryProvider directoryProvider =
|
||||
context.read<MzansiDirectoryProvider>();
|
||||
directoryProvider.setPersonalViewIndex(0);
|
||||
if (widget.username != null) {
|
||||
final user = await MihUserServices()
|
||||
.getMIHUserDetailsByUsername(widget.username!, context);
|
||||
|
|
@ -64,7 +63,7 @@ class _MzansiProfileViewState extends State<MzansiProfileView> {
|
|||
);
|
||||
} else {
|
||||
return MihPackage(
|
||||
packageActionButton: getAction(),
|
||||
packageActionButton: getAction(directoryProvider),
|
||||
packageTools: getTools(),
|
||||
packageToolBodies: getToolBody(),
|
||||
packageToolTitles: getToolTitle(),
|
||||
|
|
@ -78,13 +77,14 @@ class _MzansiProfileViewState extends State<MzansiProfileView> {
|
|||
);
|
||||
}
|
||||
|
||||
MihPackageAction getAction() {
|
||||
MihPackageAction getAction(MzansiDirectoryProvider directoryProvider) {
|
||||
return MihPackageAction(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
iconColor: MihColors.secondary(),
|
||||
iconSize: 35,
|
||||
onTap: () {
|
||||
context.pop();
|
||||
directoryProvider.setPersonalViewIndex(0);
|
||||
FocusScope.of(context).unfocus();
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -39,8 +39,7 @@ class _MihPersonalQrCodeState extends State<MihPersonalQrCode> {
|
|||
ScreenshotController screenshotController = ScreenshotController();
|
||||
Uint8List? personalQRImageFile;
|
||||
bool _isUserSignedIn = false;
|
||||
final String _qrCodedata =
|
||||
"${AppEnviroment.baseAppUrl}/mzansi-profile/view?username=";
|
||||
final String _qrCodedata = "${AppEnviroment.baseAppUrl}/mzansi-profile/view/";
|
||||
|
||||
Future<void> _checkUserSession() async {
|
||||
final doesSessionExist = await SuperTokens.doesSessionExist();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue