Refactor file URL generation to use file path instead of file ID and adjust audio player bar width for improved layout
This commit is contained in:
@@ -1188,7 +1188,7 @@ class _FileExplorerState extends State<FileExplorer>
|
|||||||
final fileService = getIt<FileService>();
|
final fileService = getIt<FileService>();
|
||||||
final url = await fileService.getFileUrl(
|
final url = await fileService.getFileUrl(
|
||||||
orgId: widget.orgId,
|
orgId: widget.orgId,
|
||||||
fileId: file.id!,
|
filePath: file.path,
|
||||||
fileName: file.name,
|
fileName: file.name,
|
||||||
);
|
);
|
||||||
// ignore: avoid_print
|
// ignore: avoid_print
|
||||||
|
|||||||
@@ -118,13 +118,13 @@ class FileService {
|
|||||||
|
|
||||||
Future<String> getFileUrl({
|
Future<String> getFileUrl({
|
||||||
required String orgId,
|
required String orgId,
|
||||||
required String fileId,
|
required String filePath,
|
||||||
String? fileName,
|
String? fileName,
|
||||||
}) async {
|
}) async {
|
||||||
// Return the full download URL
|
// Return the full download URL
|
||||||
final path = orgId.isEmpty
|
final path = orgId.isEmpty
|
||||||
? '/user/files/download?id=${Uri.encodeComponent(fileId)}'
|
? '/user/files/download?path=${Uri.encodeComponent(filePath)}'
|
||||||
: '/orgs/$orgId/files/download?id=${Uri.encodeComponent(fileId)}';
|
: '/orgs/$orgId/files/download?path=${Uri.encodeComponent(filePath)}';
|
||||||
return '$baseUrl$path';
|
return '$baseUrl$path';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ class _AudioPlayerBarState extends State<AudioPlayerBar>
|
|||||||
height: 48,
|
height: 48,
|
||||||
width:
|
width:
|
||||||
MediaQuery.of(context).size.width *
|
MediaQuery.of(context).size.width *
|
||||||
0.65, // Reduce width by 35% (100% - 35% = 65%)
|
0.25, // Reduce width to 25% for better fit
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6),
|
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6),
|
||||||
decoration: AppTheme.glassDecoration.copyWith(
|
decoration: AppTheme.glassDecoration.copyWith(
|
||||||
borderRadius: BorderRadius.circular(16),
|
borderRadius: BorderRadius.circular(16),
|
||||||
|
|||||||
Reference in New Issue
Block a user