2024-10-03 14:31:04 +08:00
|
|
|
class ShareConstants {
|
2024-10-31 14:38:32 +08:00
|
|
|
static const String publishBaseUrl = 'appflowy.com';
|
|
|
|
static const String shareBaseUrl = 'appflowy.com/app';
|
2024-10-03 14:31:04 +08:00
|
|
|
|
|
|
|
static String buildPublishUrl({
|
|
|
|
required String nameSpace,
|
|
|
|
required String publishName,
|
|
|
|
}) {
|
2024-10-31 14:38:32 +08:00
|
|
|
return 'https://$publishBaseUrl/$nameSpace/$publishName';
|
|
|
|
}
|
|
|
|
|
|
|
|
static String buildNamespaceUrl({
|
|
|
|
required String nameSpace,
|
|
|
|
bool withHttps = false,
|
|
|
|
}) {
|
|
|
|
final url = withHttps ? 'https://$publishBaseUrl' : publishBaseUrl;
|
|
|
|
return '$url/$nameSpace';
|
2024-10-03 14:31:04 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static String buildShareUrl({
|
|
|
|
required String workspaceId,
|
|
|
|
required String viewId,
|
|
|
|
String? blockId,
|
|
|
|
}) {
|
2024-10-31 14:38:32 +08:00
|
|
|
final url = 'https://$shareBaseUrl/$workspaceId/$viewId';
|
2024-10-03 14:31:04 +08:00
|
|
|
if (blockId == null || blockId.isEmpty) {
|
|
|
|
return url;
|
|
|
|
}
|
|
|
|
return '$url?blockId=$blockId';
|
|
|
|
}
|
|
|
|
}
|