feat: Enable native imaging for web

This commit is contained in:
Christian Kußowski 2025-10-24 13:32:59 +02:00
commit 6e87353e08
No known key found for this signature in database
GPG key ID: E067ECD60F1A0652
5 changed files with 14 additions and 9 deletions

View file

@ -122,7 +122,8 @@ abstract class ClientManager {
AuthenticationTypes.sso,
},
nativeImplementations: nativeImplementations,
customImageResizer: PlatformInfos.isMobile ? customImageResizer : null,
customImageResizer:
PlatformInfos.isMobile || kIsWeb ? customImageResizer : null,
defaultNetworkRequestTimeout: const Duration(minutes: 30),
enableDehydratedDevices: true,
shareKeysWith: ShareKeysWith.values

View file

@ -18,12 +18,6 @@ import 'package:native_imaging/native_imaging.dart' as native;
Future<MatrixImageFileResizedResponse?> customImageResizer(
MatrixImageFileResizeArguments arguments,
) async {
if (kIsWeb) {
throw UnsupportedError(
'customImageResizer only supports non-web platforms.',
);
}
await native.init();
var imageBytes = arguments.bytes;