feat: Enable native imaging for web
This commit is contained in:
parent
55705942ef
commit
6e87353e08
5 changed files with 14 additions and 9 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue