mirror of
https://github.com/immich-app/immich.git
synced 2026-07-30 23:50:36 -07:00
110 lines
3.5 KiB
Dart
Generated
110 lines
3.5 KiB
Dart
Generated
// Autogenerated from Pigeon (v26.3.4), do not edit directly.
|
|
// See also: https://pub.dev/packages/pigeon
|
|
// ignore_for_file: unused_import, unused_shown_name
|
|
// ignore_for_file: type=lint
|
|
|
|
import 'dart:async';
|
|
import 'dart:typed_data' show Float64List, Int32List, Int64List;
|
|
|
|
import 'package:flutter/services.dart';
|
|
import 'package:meta/meta.dart' show immutable, protected, visibleForTesting;
|
|
|
|
Object? _extractReplyValueOrThrow(
|
|
List<Object?>? replyList,
|
|
String channelName, {
|
|
required bool isNullValid,
|
|
}) {
|
|
if (replyList == null) {
|
|
throw PlatformException(
|
|
code: 'channel-error',
|
|
message: 'Unable to establish connection on channel: "$channelName".',
|
|
);
|
|
} else if (replyList.length > 1) {
|
|
throw PlatformException(
|
|
code: replyList[0]! as String,
|
|
message: replyList[1] as String?,
|
|
details: replyList[2],
|
|
);
|
|
} else if (!isNullValid && (replyList.isNotEmpty && replyList[0] == null)) {
|
|
throw PlatformException(
|
|
code: 'null-error',
|
|
message: 'Host platform returned null value for non-null return value.',
|
|
);
|
|
}
|
|
return replyList.firstOrNull;
|
|
}
|
|
|
|
|
|
|
|
class _PigeonCodec extends StandardMessageCodec {
|
|
const _PigeonCodec();
|
|
@override
|
|
void writeValue(WriteBuffer buffer, Object? value) {
|
|
if (value is int) {
|
|
buffer.putUint8(4);
|
|
buffer.putInt64(value);
|
|
} else {
|
|
super.writeValue(buffer, value);
|
|
}
|
|
}
|
|
|
|
@override
|
|
Object? readValueOfType(int type, ReadBuffer buffer) {
|
|
switch (type) {
|
|
default:
|
|
return super.readValueOfType(type, buffer);
|
|
}
|
|
}
|
|
}
|
|
|
|
class AppIconApi {
|
|
/// Constructor for [AppIconApi]. The [binaryMessenger] named argument is
|
|
/// available for dependency injection. If it is left null, the default
|
|
/// BinaryMessenger will be used which routes to the host platform.
|
|
AppIconApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''})
|
|
: pigeonVar_binaryMessenger = binaryMessenger,
|
|
pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : '';
|
|
final BinaryMessenger? pigeonVar_binaryMessenger;
|
|
|
|
static const MessageCodec<Object?> pigeonChannelCodec = _PigeonCodec();
|
|
|
|
final String pigeonVar_messageChannelSuffix;
|
|
|
|
Future<void> setAppIcon(String iconId) async {
|
|
final pigeonVar_channelName = 'dev.flutter.pigeon.immich_mobile.AppIconApi.setAppIcon$pigeonVar_messageChannelSuffix';
|
|
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
|
pigeonVar_channelName,
|
|
pigeonChannelCodec,
|
|
binaryMessenger: pigeonVar_binaryMessenger,
|
|
);
|
|
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(<Object?>[iconId]);
|
|
final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
|
|
|
|
_extractReplyValueOrThrow(
|
|
pigeonVar_replyList,
|
|
pigeonVar_channelName,
|
|
isNullValid: true,
|
|
)
|
|
;
|
|
}
|
|
|
|
Future<String> getAppIcon() async {
|
|
final pigeonVar_channelName = 'dev.flutter.pigeon.immich_mobile.AppIconApi.getAppIcon$pigeonVar_messageChannelSuffix';
|
|
final pigeonVar_channel = BasicMessageChannel<Object?>(
|
|
pigeonVar_channelName,
|
|
pigeonChannelCodec,
|
|
binaryMessenger: pigeonVar_binaryMessenger,
|
|
);
|
|
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(null);
|
|
final pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
|
|
|
|
final Object? pigeonVar_replyValue = _extractReplyValueOrThrow(
|
|
pigeonVar_replyList,
|
|
pigeonVar_channelName,
|
|
isNullValid: false,
|
|
)
|
|
;
|
|
return pigeonVar_replyValue! as String;
|
|
}
|
|
}
|