diff --git a/lib/route.dart b/lib/route.dart index c3f0fde7..7b6bfc06 100644 --- a/lib/route.dart +++ b/lib/route.dart @@ -367,6 +367,15 @@ final routerProvider = Provider((ref) { appId: state.pathParameters['appId']!, ), ), + GoRoute( + name: 'developerBotNew', + path: 'bots/new', + builder: + (context, state) => NewBotScreen( + publisherName: state.pathParameters['name']!, + projectId: state.pathParameters['projectId']!, + ), + ), GoRoute( name: 'developerBotDetail', path: 'bots/:botId', @@ -377,15 +386,6 @@ final routerProvider = Provider((ref) { botId: state.pathParameters['botId']!, ), ), - GoRoute( - name: 'developerBotNew', - path: 'bots/new', - builder: - (context, state) => NewBotScreen( - publisherName: state.pathParameters['name']!, - projectId: state.pathParameters['projectId']!, - ), - ), GoRoute( name: 'developerBotEdit', path: 'bots/:id/edit', diff --git a/lib/services/file_uploader.dart b/lib/services/file_uploader.dart index 886b2533..f89a8e57 100644 --- a/lib/services/file_uploader.dart +++ b/lib/services/file_uploader.dart @@ -282,8 +282,17 @@ class FileUploader { final mime = data.mimeType; if (mime != null && mime.isNotEmpty) return mime; final filename = file.displayName ?? data.name; - final detected = lookupMimeType(filename); - if (detected != null) return detected; + if (filename.isNotEmpty) { + final detected = lookupMimeType(filename); + if (detected != null) return detected; + } else { + return switch (file.type) { + UniversalFileType.image => 'image/unknown', + UniversalFileType.audio => 'audio/unknown', + UniversalFileType.video => 'video/unknown', + _ => 'application/unknown', + }; + } throw Exception('Cannot detect mime type for file: $filename'); } else if (data is List || data is Uint8List) { return 'application/octet-stream'; diff --git a/macos/Podfile.lock b/macos/Podfile.lock index b9ceafac..e5322c0c 100644 --- a/macos/Podfile.lock +++ b/macos/Podfile.lock @@ -1,4 +1,6 @@ PODS: + - app_links (6.4.1): + - FlutterMacOS - connectivity_plus (0.0.1): - FlutterMacOS - croppy (0.0.1): @@ -239,6 +241,8 @@ PODS: - sqlite3/session - super_native_extensions (0.0.1): - FlutterMacOS + - syncfusion_pdfviewer_macos (0.0.1): + - FlutterMacOS - tray_manager (0.0.1): - FlutterMacOS - url_launcher_macos (0.0.1): @@ -252,6 +256,7 @@ PODS: - FlutterMacOS DEPENDENCIES: + - app_links (from `Flutter/ephemeral/.symlinks/plugins/app_links/macos`) - connectivity_plus (from `Flutter/ephemeral/.symlinks/plugins/connectivity_plus/macos`) - croppy (from `Flutter/ephemeral/.symlinks/plugins/croppy/macos`) - device_info_plus (from `Flutter/ephemeral/.symlinks/plugins/device_info_plus/macos`) @@ -287,6 +292,7 @@ DEPENDENCIES: - sqflite_darwin (from `Flutter/ephemeral/.symlinks/plugins/sqflite_darwin/darwin`) - sqlite3_flutter_libs (from `Flutter/ephemeral/.symlinks/plugins/sqlite3_flutter_libs/darwin`) - super_native_extensions (from `Flutter/ephemeral/.symlinks/plugins/super_native_extensions/macos`) + - syncfusion_pdfviewer_macos (from `Flutter/ephemeral/.symlinks/plugins/syncfusion_pdfviewer_macos/macos`) - tray_manager (from `Flutter/ephemeral/.symlinks/plugins/tray_manager/macos`) - url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`) - volume_controller (from `Flutter/ephemeral/.symlinks/plugins/volume_controller/macos`) @@ -317,6 +323,8 @@ SPEC REPOS: - WebRTC-SDK EXTERNAL SOURCES: + app_links: + :path: Flutter/ephemeral/.symlinks/plugins/app_links/macos connectivity_plus: :path: Flutter/ephemeral/.symlinks/plugins/connectivity_plus/macos croppy: @@ -387,6 +395,8 @@ EXTERNAL SOURCES: :path: Flutter/ephemeral/.symlinks/plugins/sqlite3_flutter_libs/darwin super_native_extensions: :path: Flutter/ephemeral/.symlinks/plugins/super_native_extensions/macos + syncfusion_pdfviewer_macos: + :path: Flutter/ephemeral/.symlinks/plugins/syncfusion_pdfviewer_macos/macos tray_manager: :path: Flutter/ephemeral/.symlinks/plugins/tray_manager/macos url_launcher_macos: @@ -399,6 +409,7 @@ EXTERNAL SOURCES: :path: Flutter/ephemeral/.symlinks/plugins/window_manager/macos SPEC CHECKSUMS: + app_links: 05a6ec2341985eb05e9f97dc63f5837c39895c3f connectivity_plus: 4adf20a405e25b42b9c9f87feff8f4b6fde18a4e croppy: d9bfc8c02f3cd1851f669a421df298a474b78f43 device_info_plus: 4fb280989f669696856f8b129e4a5e3cd6c48f76 @@ -453,6 +464,7 @@ SPEC CHECKSUMS: sqlite3: 73513155ec6979715d3904ef53a8d68892d4032b sqlite3_flutter_libs: 83f8e9f5b6554077f1d93119fe20ebaa5f3a9ef1 super_native_extensions: c2795d6d9aedf4a79fae25cb6160b71b50549189 + syncfusion_pdfviewer_macos: b3b110c68039178ca4105dd03ef38761eca3b36b tray_manager: a104b5c81b578d83f3c3d0f40a997c8b10810166 url_launcher_macos: 0fba8ddabfc33ce0a9afe7c5fef5aab3d8d2d673 volume_controller: 5c068e6d085c80dadd33fc2c918d2114b775b3dd