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 url = await fileService.getFileUrl(
|
||||
orgId: widget.orgId,
|
||||
fileId: file.id!,
|
||||
filePath: file.path,
|
||||
fileName: file.name,
|
||||
);
|
||||
// ignore: avoid_print
|
||||
|
||||
@@ -118,13 +118,13 @@ class FileService {
|
||||
|
||||
Future<String> getFileUrl({
|
||||
required String orgId,
|
||||
required String fileId,
|
||||
required String filePath,
|
||||
String? fileName,
|
||||
}) async {
|
||||
// Return the full download URL
|
||||
final path = orgId.isEmpty
|
||||
? '/user/files/download?id=${Uri.encodeComponent(fileId)}'
|
||||
: '/orgs/$orgId/files/download?id=${Uri.encodeComponent(fileId)}';
|
||||
? '/user/files/download?path=${Uri.encodeComponent(filePath)}'
|
||||
: '/orgs/$orgId/files/download?path=${Uri.encodeComponent(filePath)}';
|
||||
return '$baseUrl$path';
|
||||
}
|
||||
|
||||
|
||||
@@ -193,7 +193,7 @@ class _AudioPlayerBarState extends State<AudioPlayerBar>
|
||||
height: 48,
|
||||
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),
|
||||
decoration: AppTheme.glassDecoration.copyWith(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
|
||||
Reference in New Issue
Block a user