diff --git a/analysis_options.yaml b/analysis_options.yaml index 35b5e0a..50c8b53 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -1,4 +1,4 @@ -include: package:pedantic/analysis_options.yaml +include: package:lints/recommended.yaml analyzer: exclude: @@ -10,7 +10,6 @@ linter: # Error Rules avoid_empty_else: true avoid_relative_lib_imports: true - avoid_returning_null_for_future: true avoid_slow_async_io: true avoid_types_as_parameter_names: true control_flow_in_finally: true diff --git a/example/macos/Flutter/GeneratedPluginRegistrant.swift b/example/macos/Flutter/GeneratedPluginRegistrant.swift index 4d13ec1..6726dd8 100644 --- a/example/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/example/macos/Flutter/GeneratedPluginRegistrant.swift @@ -6,9 +6,7 @@ import FlutterMacOS import Foundation import bonsoir_darwin -import connectivity_plus func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { SwiftBonsoirPlugin.register(with: registry.registrar(forPlugin: "SwiftBonsoirPlugin")) - ConnectivityPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlugin")) } diff --git a/lib/cast_channel/cast_channel.pb.dart b/lib/cast_channel/cast_channel.pb.dart index 29b7103..762657e 100644 --- a/lib/cast_channel/cast_channel.pb.dart +++ b/lib/cast_channel/cast_channel.pb.dart @@ -1,9 +1,14 @@ -/// -// Generated code. Do not modify. -// source: cast_channel.proto +// This is a generated file - do not edit. // -// @dart = 2.12 -// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields +// Generated from cast_channel.proto. + +// @dart = 3.3 + +// ignore_for_file: annotate_overrides, camel_case_types, comment_references +// ignore_for_file: constant_identifier_names +// ignore_for_file: curly_braces_in_flow_control_structures +// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes +// ignore_for_file: non_constant_identifier_names import 'dart:core' as $core; @@ -11,20 +16,11 @@ import 'package:protobuf/protobuf.dart' as $pb; import 'cast_channel.pbenum.dart'; +export 'package:protobuf/protobuf.dart' show GeneratedMessageGenericExtensions; + export 'cast_channel.pbenum.dart'; class CastMessage extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'CastMessage', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'extensions.api.cast_channel'), createEmptyInstance: create) - ..e(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'protocolVersion', $pb.PbFieldType.QE, defaultOrMaker: CastMessage_ProtocolVersion.CASTV2_1_0, valueOf: CastMessage_ProtocolVersion.valueOf, enumValues: CastMessage_ProtocolVersion.values) - ..aQS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'sourceId') - ..aQS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'destinationId') - ..aQS(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'namespace') - ..e(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'payloadType', $pb.PbFieldType.QE, defaultOrMaker: CastMessage_PayloadType.STRING, valueOf: CastMessage_PayloadType.valueOf, enumValues: CastMessage_PayloadType.values) - ..aOS(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'payloadUtf8') - ..a<$core.List<$core.int>>(7, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'payloadBinary', $pb.PbFieldType.OY) - ; - - CastMessage._() : super(); factory CastMessage({ CastMessage_ProtocolVersion? protocolVersion, $core.String? sourceId, @@ -34,335 +30,417 @@ class CastMessage extends $pb.GeneratedMessage { $core.String? payloadUtf8, $core.List<$core.int>? payloadBinary, }) { - final _result = create(); - if (protocolVersion != null) { - _result.protocolVersion = protocolVersion; - } - if (sourceId != null) { - _result.sourceId = sourceId; - } - if (destinationId != null) { - _result.destinationId = destinationId; - } - if (namespace != null) { - _result.namespace = namespace; - } - if (payloadType != null) { - _result.payloadType = payloadType; - } - if (payloadUtf8 != null) { - _result.payloadUtf8 = payloadUtf8; - } - if (payloadBinary != null) { - _result.payloadBinary = payloadBinary; - } - return _result; + final result = create(); + if (protocolVersion != null) result.protocolVersion = protocolVersion; + if (sourceId != null) result.sourceId = sourceId; + if (destinationId != null) result.destinationId = destinationId; + if (namespace != null) result.namespace = namespace; + if (payloadType != null) result.payloadType = payloadType; + if (payloadUtf8 != null) result.payloadUtf8 = payloadUtf8; + if (payloadBinary != null) result.payloadBinary = payloadBinary; + return result; } - factory CastMessage.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory CastMessage.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - CastMessage clone() => CastMessage()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - CastMessage copyWith(void Function(CastMessage) updates) => super.copyWith((message) => updates(message as CastMessage)) as CastMessage; // ignore: deprecated_member_use + + CastMessage._(); + + factory CastMessage.fromBuffer($core.List<$core.int> data, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(data, registry); + factory CastMessage.fromJson($core.String json, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(json, registry); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'CastMessage', + package: const $pb.PackageName( + _omitMessageNames ? '' : 'extensions.api.cast_channel'), + createEmptyInstance: create) + ..aE( + 1, _omitFieldNames ? '' : 'protocolVersion', + fieldType: $pb.PbFieldType.QE, + enumValues: CastMessage_ProtocolVersion.values) + ..aQS(2, _omitFieldNames ? '' : 'sourceId') + ..aQS(3, _omitFieldNames ? '' : 'destinationId') + ..aQS(4, _omitFieldNames ? '' : 'namespace') + ..aE(5, _omitFieldNames ? '' : 'payloadType', + fieldType: $pb.PbFieldType.QE, + enumValues: CastMessage_PayloadType.values) + ..aOS(6, _omitFieldNames ? '' : 'payloadUtf8') + ..a<$core.List<$core.int>>( + 7, _omitFieldNames ? '' : 'payloadBinary', $pb.PbFieldType.OY); + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + CastMessage clone() => deepCopy(); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + CastMessage copyWith(void Function(CastMessage) updates) => + super.copyWith((message) => updates(message as CastMessage)) + as CastMessage; + + @$core.override $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') static CastMessage create() => CastMessage._(); + @$core.override CastMessage createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') - static CastMessage getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static CastMessage getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); static CastMessage? _defaultInstance; @$pb.TagNumber(1) CastMessage_ProtocolVersion get protocolVersion => $_getN(0); @$pb.TagNumber(1) - set protocolVersion(CastMessage_ProtocolVersion v) { setField(1, v); } + set protocolVersion(CastMessage_ProtocolVersion value) => + $_setField(1, value); @$pb.TagNumber(1) $core.bool hasProtocolVersion() => $_has(0); @$pb.TagNumber(1) - void clearProtocolVersion() => clearField(1); + void clearProtocolVersion() => $_clearField(1); + /// source and destination ids identify the origin and destination of the + /// message. They are used to route messages between endpoints that share a + /// device-to-device channel. + /// + /// For messages between applications: + /// - The sender application id is a unique identifier generated on behalf of + /// the sender application. + /// - The receiver id is always the the session id for the application. + /// + /// For messages to or from the sender or receiver platform, the special ids + /// 'sender-0' and 'receiver-0' can be used. + /// + /// For messages intended for all endpoints using a given channel, the + /// wildcard destination_id '*' can be used. @$pb.TagNumber(2) $core.String get sourceId => $_getSZ(1); @$pb.TagNumber(2) - set sourceId($core.String v) { $_setString(1, v); } + set sourceId($core.String value) => $_setString(1, value); @$pb.TagNumber(2) $core.bool hasSourceId() => $_has(1); @$pb.TagNumber(2) - void clearSourceId() => clearField(2); + void clearSourceId() => $_clearField(2); @$pb.TagNumber(3) $core.String get destinationId => $_getSZ(2); @$pb.TagNumber(3) - set destinationId($core.String v) { $_setString(2, v); } + set destinationId($core.String value) => $_setString(2, value); @$pb.TagNumber(3) $core.bool hasDestinationId() => $_has(2); @$pb.TagNumber(3) - void clearDestinationId() => clearField(3); + void clearDestinationId() => $_clearField(3); + /// This is the core multiplexing key. All messages are sent on a namespace + /// and endpoints sharing a channel listen on one or more namespaces. The + /// namespace defines the protocol and semantics of the message. @$pb.TagNumber(4) $core.String get namespace => $_getSZ(3); @$pb.TagNumber(4) - set namespace($core.String v) { $_setString(3, v); } + set namespace($core.String value) => $_setString(3, value); @$pb.TagNumber(4) $core.bool hasNamespace() => $_has(3); @$pb.TagNumber(4) - void clearNamespace() => clearField(4); + void clearNamespace() => $_clearField(4); @$pb.TagNumber(5) CastMessage_PayloadType get payloadType => $_getN(4); @$pb.TagNumber(5) - set payloadType(CastMessage_PayloadType v) { setField(5, v); } + set payloadType(CastMessage_PayloadType value) => $_setField(5, value); @$pb.TagNumber(5) $core.bool hasPayloadType() => $_has(4); @$pb.TagNumber(5) - void clearPayloadType() => clearField(5); + void clearPayloadType() => $_clearField(5); + /// Depending on payload_type, exactly one of the following optional fields + /// will always be set. @$pb.TagNumber(6) $core.String get payloadUtf8 => $_getSZ(5); @$pb.TagNumber(6) - set payloadUtf8($core.String v) { $_setString(5, v); } + set payloadUtf8($core.String value) => $_setString(5, value); @$pb.TagNumber(6) $core.bool hasPayloadUtf8() => $_has(5); @$pb.TagNumber(6) - void clearPayloadUtf8() => clearField(6); + void clearPayloadUtf8() => $_clearField(6); @$pb.TagNumber(7) $core.List<$core.int> get payloadBinary => $_getN(6); @$pb.TagNumber(7) - set payloadBinary($core.List<$core.int> v) { $_setBytes(6, v); } + set payloadBinary($core.List<$core.int> value) => $_setBytes(6, value); @$pb.TagNumber(7) $core.bool hasPayloadBinary() => $_has(6); @$pb.TagNumber(7) - void clearPayloadBinary() => clearField(7); + void clearPayloadBinary() => $_clearField(7); } +/// Messages for authentication protocol between a sender and a receiver. class AuthChallenge extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'AuthChallenge', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'extensions.api.cast_channel'), createEmptyInstance: create) - ..hasRequiredFields = false - ; - - AuthChallenge._() : super(); factory AuthChallenge() => create(); - factory AuthChallenge.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory AuthChallenge.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - AuthChallenge clone() => AuthChallenge()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - AuthChallenge copyWith(void Function(AuthChallenge) updates) => super.copyWith((message) => updates(message as AuthChallenge)) as AuthChallenge; // ignore: deprecated_member_use + + AuthChallenge._(); + + factory AuthChallenge.fromBuffer($core.List<$core.int> data, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(data, registry); + factory AuthChallenge.fromJson($core.String json, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(json, registry); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'AuthChallenge', + package: const $pb.PackageName( + _omitMessageNames ? '' : 'extensions.api.cast_channel'), + createEmptyInstance: create) + ..hasRequiredFields = false; + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + AuthChallenge clone() => deepCopy(); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + AuthChallenge copyWith(void Function(AuthChallenge) updates) => + super.copyWith((message) => updates(message as AuthChallenge)) + as AuthChallenge; + + @$core.override $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') static AuthChallenge create() => AuthChallenge._(); + @$core.override AuthChallenge createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); + static $pb.PbList createRepeated() => + $pb.PbList(); @$core.pragma('dart2js:noInline') - static AuthChallenge getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static AuthChallenge getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); static AuthChallenge? _defaultInstance; } class AuthResponse extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'AuthResponse', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'extensions.api.cast_channel'), createEmptyInstance: create) - ..a<$core.List<$core.int>>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'signature', $pb.PbFieldType.QY) - ..a<$core.List<$core.int>>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'clientAuthCertificate', $pb.PbFieldType.QY) - ..p<$core.List<$core.int>>(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'clientCa', $pb.PbFieldType.PY) - ; - - AuthResponse._() : super(); factory AuthResponse({ $core.List<$core.int>? signature, $core.List<$core.int>? clientAuthCertificate, $core.Iterable<$core.List<$core.int>>? clientCa, }) { - final _result = create(); - if (signature != null) { - _result.signature = signature; - } - if (clientAuthCertificate != null) { - _result.clientAuthCertificate = clientAuthCertificate; - } - if (clientCa != null) { - _result.clientCa.addAll(clientCa); - } - return _result; + final result = create(); + if (signature != null) result.signature = signature; + if (clientAuthCertificate != null) + result.clientAuthCertificate = clientAuthCertificate; + if (clientCa != null) result.clientCa.addAll(clientCa); + return result; } - factory AuthResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory AuthResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - AuthResponse clone() => AuthResponse()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - AuthResponse copyWith(void Function(AuthResponse) updates) => super.copyWith((message) => updates(message as AuthResponse)) as AuthResponse; // ignore: deprecated_member_use + + AuthResponse._(); + + factory AuthResponse.fromBuffer($core.List<$core.int> data, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(data, registry); + factory AuthResponse.fromJson($core.String json, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(json, registry); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'AuthResponse', + package: const $pb.PackageName( + _omitMessageNames ? '' : 'extensions.api.cast_channel'), + createEmptyInstance: create) + ..a<$core.List<$core.int>>( + 1, _omitFieldNames ? '' : 'signature', $pb.PbFieldType.QY) + ..a<$core.List<$core.int>>( + 2, _omitFieldNames ? '' : 'clientAuthCertificate', $pb.PbFieldType.QY) + ..p<$core.List<$core.int>>( + 3, _omitFieldNames ? '' : 'clientCa', $pb.PbFieldType.PY); + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + AuthResponse clone() => deepCopy(); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + AuthResponse copyWith(void Function(AuthResponse) updates) => + super.copyWith((message) => updates(message as AuthResponse)) + as AuthResponse; + + @$core.override $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') static AuthResponse create() => AuthResponse._(); + @$core.override AuthResponse createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); + static $pb.PbList createRepeated() => + $pb.PbList(); @$core.pragma('dart2js:noInline') - static AuthResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static AuthResponse getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); static AuthResponse? _defaultInstance; @$pb.TagNumber(1) $core.List<$core.int> get signature => $_getN(0); @$pb.TagNumber(1) - set signature($core.List<$core.int> v) { $_setBytes(0, v); } + set signature($core.List<$core.int> value) => $_setBytes(0, value); @$pb.TagNumber(1) $core.bool hasSignature() => $_has(0); @$pb.TagNumber(1) - void clearSignature() => clearField(1); + void clearSignature() => $_clearField(1); @$pb.TagNumber(2) $core.List<$core.int> get clientAuthCertificate => $_getN(1); @$pb.TagNumber(2) - set clientAuthCertificate($core.List<$core.int> v) { $_setBytes(1, v); } + set clientAuthCertificate($core.List<$core.int> value) => + $_setBytes(1, value); @$pb.TagNumber(2) $core.bool hasClientAuthCertificate() => $_has(1); @$pb.TagNumber(2) - void clearClientAuthCertificate() => clearField(2); + void clearClientAuthCertificate() => $_clearField(2); @$pb.TagNumber(3) - $core.List<$core.List<$core.int>> get clientCa => $_getList(2); + $pb.PbList<$core.List<$core.int>> get clientCa => $_getList(2); } class AuthError extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'AuthError', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'extensions.api.cast_channel'), createEmptyInstance: create) - ..e(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'errorType', $pb.PbFieldType.QE, defaultOrMaker: AuthError_ErrorType.INTERNAL_ERROR, valueOf: AuthError_ErrorType.valueOf, enumValues: AuthError_ErrorType.values) - ; - - AuthError._() : super(); factory AuthError({ AuthError_ErrorType? errorType, }) { - final _result = create(); - if (errorType != null) { - _result.errorType = errorType; - } - return _result; + final result = create(); + if (errorType != null) result.errorType = errorType; + return result; } - factory AuthError.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory AuthError.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - AuthError clone() => AuthError()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - AuthError copyWith(void Function(AuthError) updates) => super.copyWith((message) => updates(message as AuthError)) as AuthError; // ignore: deprecated_member_use + + AuthError._(); + + factory AuthError.fromBuffer($core.List<$core.int> data, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(data, registry); + factory AuthError.fromJson($core.String json, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(json, registry); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'AuthError', + package: const $pb.PackageName( + _omitMessageNames ? '' : 'extensions.api.cast_channel'), + createEmptyInstance: create) + ..aE(1, _omitFieldNames ? '' : 'errorType', + fieldType: $pb.PbFieldType.QE, enumValues: AuthError_ErrorType.values); + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + AuthError clone() => deepCopy(); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + AuthError copyWith(void Function(AuthError) updates) => + super.copyWith((message) => updates(message as AuthError)) as AuthError; + + @$core.override $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') static AuthError create() => AuthError._(); + @$core.override AuthError createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') - static AuthError getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static AuthError getDefault() => + _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static AuthError? _defaultInstance; @$pb.TagNumber(1) AuthError_ErrorType get errorType => $_getN(0); @$pb.TagNumber(1) - set errorType(AuthError_ErrorType v) { setField(1, v); } + set errorType(AuthError_ErrorType value) => $_setField(1, value); @$pb.TagNumber(1) $core.bool hasErrorType() => $_has(0); @$pb.TagNumber(1) - void clearErrorType() => clearField(1); + void clearErrorType() => $_clearField(1); } class DeviceAuthMessage extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'DeviceAuthMessage', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'extensions.api.cast_channel'), createEmptyInstance: create) - ..aOM(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'challenge', subBuilder: AuthChallenge.create) - ..aOM(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'response', subBuilder: AuthResponse.create) - ..aOM(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'error', subBuilder: AuthError.create) - ; - - DeviceAuthMessage._() : super(); factory DeviceAuthMessage({ AuthChallenge? challenge, AuthResponse? response, AuthError? error, }) { - final _result = create(); - if (challenge != null) { - _result.challenge = challenge; - } - if (response != null) { - _result.response = response; - } - if (error != null) { - _result.error = error; - } - return _result; + final result = create(); + if (challenge != null) result.challenge = challenge; + if (response != null) result.response = response; + if (error != null) result.error = error; + return result; } - factory DeviceAuthMessage.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory DeviceAuthMessage.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - DeviceAuthMessage clone() => DeviceAuthMessage()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - DeviceAuthMessage copyWith(void Function(DeviceAuthMessage) updates) => super.copyWith((message) => updates(message as DeviceAuthMessage)) as DeviceAuthMessage; // ignore: deprecated_member_use + + DeviceAuthMessage._(); + + factory DeviceAuthMessage.fromBuffer($core.List<$core.int> data, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(data, registry); + factory DeviceAuthMessage.fromJson($core.String json, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(json, registry); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'DeviceAuthMessage', + package: const $pb.PackageName( + _omitMessageNames ? '' : 'extensions.api.cast_channel'), + createEmptyInstance: create) + ..aOM(1, _omitFieldNames ? '' : 'challenge', + subBuilder: AuthChallenge.create) + ..aOM(2, _omitFieldNames ? '' : 'response', + subBuilder: AuthResponse.create) + ..aOM(3, _omitFieldNames ? '' : 'error', + subBuilder: AuthError.create); + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + DeviceAuthMessage clone() => deepCopy(); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + DeviceAuthMessage copyWith(void Function(DeviceAuthMessage) updates) => + super.copyWith((message) => updates(message as DeviceAuthMessage)) + as DeviceAuthMessage; + + @$core.override $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') static DeviceAuthMessage create() => DeviceAuthMessage._(); + @$core.override DeviceAuthMessage createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); + static $pb.PbList createRepeated() => + $pb.PbList(); @$core.pragma('dart2js:noInline') - static DeviceAuthMessage getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static DeviceAuthMessage getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); static DeviceAuthMessage? _defaultInstance; + /// Request fields @$pb.TagNumber(1) AuthChallenge get challenge => $_getN(0); @$pb.TagNumber(1) - set challenge(AuthChallenge v) { setField(1, v); } + set challenge(AuthChallenge value) => $_setField(1, value); @$pb.TagNumber(1) $core.bool hasChallenge() => $_has(0); @$pb.TagNumber(1) - void clearChallenge() => clearField(1); + void clearChallenge() => $_clearField(1); @$pb.TagNumber(1) AuthChallenge ensureChallenge() => $_ensure(0); + /// Response fields @$pb.TagNumber(2) AuthResponse get response => $_getN(1); @$pb.TagNumber(2) - set response(AuthResponse v) { setField(2, v); } + set response(AuthResponse value) => $_setField(2, value); @$pb.TagNumber(2) $core.bool hasResponse() => $_has(1); @$pb.TagNumber(2) - void clearResponse() => clearField(2); + void clearResponse() => $_clearField(2); @$pb.TagNumber(2) AuthResponse ensureResponse() => $_ensure(1); @$pb.TagNumber(3) AuthError get error => $_getN(2); @$pb.TagNumber(3) - set error(AuthError v) { setField(3, v); } + set error(AuthError value) => $_setField(3, value); @$pb.TagNumber(3) $core.bool hasError() => $_has(2); @$pb.TagNumber(3) - void clearError() => clearField(3); + void clearError() => $_clearField(3); @$pb.TagNumber(3) AuthError ensureError() => $_ensure(2); } +const $core.bool _omitFieldNames = + $core.bool.fromEnvironment('protobuf.omit_field_names'); +const $core.bool _omitMessageNames = + $core.bool.fromEnvironment('protobuf.omit_message_names'); diff --git a/lib/cast_channel/cast_channel.pbenum.dart b/lib/cast_channel/cast_channel.pbenum.dart index 7a0ced2..6562906 100644 --- a/lib/cast_channel/cast_channel.pbenum.dart +++ b/lib/cast_channel/cast_channel.pbenum.dart @@ -1,54 +1,77 @@ -/// -// Generated code. Do not modify. -// source: cast_channel.proto +// This is a generated file - do not edit. // -// @dart = 2.12 -// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields +// Generated from cast_channel.proto. + +// @dart = 3.3 + +// ignore_for_file: annotate_overrides, camel_case_types, comment_references +// ignore_for_file: constant_identifier_names +// ignore_for_file: curly_braces_in_flow_control_structures +// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes +// ignore_for_file: non_constant_identifier_names -// ignore_for_file: UNDEFINED_SHOWN_NAME import 'dart:core' as $core; + import 'package:protobuf/protobuf.dart' as $pb; +/// Always pass a version of the protocol for future compatibility +/// requirements. class CastMessage_ProtocolVersion extends $pb.ProtobufEnum { - static const CastMessage_ProtocolVersion CASTV2_1_0 = CastMessage_ProtocolVersion._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'CASTV2_1_0'); + static const CastMessage_ProtocolVersion CASTV2_1_0 = + CastMessage_ProtocolVersion._(0, _omitEnumNames ? '' : 'CASTV2_1_0'); - static const $core.List values = [ + static const $core.List values = + [ CASTV2_1_0, ]; - static final $core.Map<$core.int, CastMessage_ProtocolVersion> _byValue = $pb.ProtobufEnum.initByValue(values); - static CastMessage_ProtocolVersion? valueOf($core.int value) => _byValue[value]; + static final $core.List _byValue = + $pb.ProtobufEnum.$_initByValueList(values, 0); + static CastMessage_ProtocolVersion? valueOf($core.int value) => + value < 0 || value >= _byValue.length ? null : _byValue[value]; - const CastMessage_ProtocolVersion._($core.int v, $core.String n) : super(v, n); + const CastMessage_ProtocolVersion._(super.value, super.name); } +/// What type of data do we have in this message. class CastMessage_PayloadType extends $pb.ProtobufEnum { - static const CastMessage_PayloadType STRING = CastMessage_PayloadType._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'STRING'); - static const CastMessage_PayloadType BINARY = CastMessage_PayloadType._(1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'BINARY'); + static const CastMessage_PayloadType STRING = + CastMessage_PayloadType._(0, _omitEnumNames ? '' : 'STRING'); + static const CastMessage_PayloadType BINARY = + CastMessage_PayloadType._(1, _omitEnumNames ? '' : 'BINARY'); - static const $core.List values = [ + static const $core.List values = + [ STRING, BINARY, ]; - static final $core.Map<$core.int, CastMessage_PayloadType> _byValue = $pb.ProtobufEnum.initByValue(values); - static CastMessage_PayloadType? valueOf($core.int value) => _byValue[value]; + static final $core.List _byValue = + $pb.ProtobufEnum.$_initByValueList(values, 1); + static CastMessage_PayloadType? valueOf($core.int value) => + value < 0 || value >= _byValue.length ? null : _byValue[value]; - const CastMessage_PayloadType._($core.int v, $core.String n) : super(v, n); + const CastMessage_PayloadType._(super.value, super.name); } class AuthError_ErrorType extends $pb.ProtobufEnum { - static const AuthError_ErrorType INTERNAL_ERROR = AuthError_ErrorType._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'INTERNAL_ERROR'); - static const AuthError_ErrorType NO_TLS = AuthError_ErrorType._(1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'NO_TLS'); + static const AuthError_ErrorType INTERNAL_ERROR = + AuthError_ErrorType._(0, _omitEnumNames ? '' : 'INTERNAL_ERROR'); + static const AuthError_ErrorType NO_TLS = + AuthError_ErrorType._(1, _omitEnumNames ? '' : 'NO_TLS'); - static const $core.List values = [ + static const $core.List values = [ INTERNAL_ERROR, NO_TLS, ]; - static final $core.Map<$core.int, AuthError_ErrorType> _byValue = $pb.ProtobufEnum.initByValue(values); - static AuthError_ErrorType? valueOf($core.int value) => _byValue[value]; + static final $core.List _byValue = + $pb.ProtobufEnum.$_initByValueList(values, 1); + static AuthError_ErrorType? valueOf($core.int value) => + value < 0 || value >= _byValue.length ? null : _byValue[value]; - const AuthError_ErrorType._($core.int v, $core.String n) : super(v, n); + const AuthError_ErrorType._(super.value, super.name); } +const $core.bool _omitEnumNames = + $core.bool.fromEnvironment('protobuf.omit_enum_names'); diff --git a/lib/cast_channel/cast_channel.pbjson.dart b/lib/cast_channel/cast_channel.pbjson.dart index f82a6bf..6e72282 100644 --- a/lib/cast_channel/cast_channel.pbjson.dart +++ b/lib/cast_channel/cast_channel.pbjson.dart @@ -1,95 +1,174 @@ -/// -// Generated code. Do not modify. -// source: cast_channel.proto +// This is a generated file - do not edit. // -// @dart = 2.12 -// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package +// Generated from cast_channel.proto. + +// @dart = 3.3 + +// ignore_for_file: annotate_overrides, camel_case_types, comment_references +// ignore_for_file: constant_identifier_names +// ignore_for_file: curly_braces_in_flow_control_structures +// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes +// ignore_for_file: non_constant_identifier_names, unused_import -import 'dart:core' as $core; import 'dart:convert' as $convert; +import 'dart:core' as $core; import 'dart:typed_data' as $typed_data; + @$core.Deprecated('Use castMessageDescriptor instead') -const CastMessage$json = const { +const CastMessage$json = { '1': 'CastMessage', - '2': const [ - const {'1': 'protocol_version', '3': 1, '4': 2, '5': 14, '6': '.extensions.api.cast_channel.CastMessage.ProtocolVersion', '10': 'protocolVersion'}, - const {'1': 'source_id', '3': 2, '4': 2, '5': 9, '10': 'sourceId'}, - const {'1': 'destination_id', '3': 3, '4': 2, '5': 9, '10': 'destinationId'}, - const {'1': 'namespace', '3': 4, '4': 2, '5': 9, '10': 'namespace'}, - const {'1': 'payload_type', '3': 5, '4': 2, '5': 14, '6': '.extensions.api.cast_channel.CastMessage.PayloadType', '10': 'payloadType'}, - const {'1': 'payload_utf8', '3': 6, '4': 1, '5': 9, '10': 'payloadUtf8'}, - const {'1': 'payload_binary', '3': 7, '4': 1, '5': 12, '10': 'payloadBinary'}, + '2': [ + { + '1': 'protocol_version', + '3': 1, + '4': 2, + '5': 14, + '6': '.extensions.api.cast_channel.CastMessage.ProtocolVersion', + '10': 'protocolVersion' + }, + {'1': 'source_id', '3': 2, '4': 2, '5': 9, '10': 'sourceId'}, + {'1': 'destination_id', '3': 3, '4': 2, '5': 9, '10': 'destinationId'}, + {'1': 'namespace', '3': 4, '4': 2, '5': 9, '10': 'namespace'}, + { + '1': 'payload_type', + '3': 5, + '4': 2, + '5': 14, + '6': '.extensions.api.cast_channel.CastMessage.PayloadType', + '10': 'payloadType' + }, + {'1': 'payload_utf8', '3': 6, '4': 1, '5': 9, '10': 'payloadUtf8'}, + {'1': 'payload_binary', '3': 7, '4': 1, '5': 12, '10': 'payloadBinary'}, ], - '4': const [CastMessage_ProtocolVersion$json, CastMessage_PayloadType$json], + '4': [CastMessage_ProtocolVersion$json, CastMessage_PayloadType$json], }; @$core.Deprecated('Use castMessageDescriptor instead') -const CastMessage_ProtocolVersion$json = const { +const CastMessage_ProtocolVersion$json = { '1': 'ProtocolVersion', - '2': const [ - const {'1': 'CASTV2_1_0', '2': 0}, + '2': [ + {'1': 'CASTV2_1_0', '2': 0}, ], }; @$core.Deprecated('Use castMessageDescriptor instead') -const CastMessage_PayloadType$json = const { +const CastMessage_PayloadType$json = { '1': 'PayloadType', - '2': const [ - const {'1': 'STRING', '2': 0}, - const {'1': 'BINARY', '2': 1}, + '2': [ + {'1': 'STRING', '2': 0}, + {'1': 'BINARY', '2': 1}, ], }; /// Descriptor for `CastMessage`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List castMessageDescriptor = $convert.base64Decode('CgtDYXN0TWVzc2FnZRJjChBwcm90b2NvbF92ZXJzaW9uGAEgAigOMjguZXh0ZW5zaW9ucy5hcGkuY2FzdF9jaGFubmVsLkNhc3RNZXNzYWdlLlByb3RvY29sVmVyc2lvblIPcHJvdG9jb2xWZXJzaW9uEhsKCXNvdXJjZV9pZBgCIAIoCVIIc291cmNlSWQSJQoOZGVzdGluYXRpb25faWQYAyACKAlSDWRlc3RpbmF0aW9uSWQSHAoJbmFtZXNwYWNlGAQgAigJUgluYW1lc3BhY2USVwoMcGF5bG9hZF90eXBlGAUgAigOMjQuZXh0ZW5zaW9ucy5hcGkuY2FzdF9jaGFubmVsLkNhc3RNZXNzYWdlLlBheWxvYWRUeXBlUgtwYXlsb2FkVHlwZRIhCgxwYXlsb2FkX3V0ZjgYBiABKAlSC3BheWxvYWRVdGY4EiUKDnBheWxvYWRfYmluYXJ5GAcgASgMUg1wYXlsb2FkQmluYXJ5IiEKD1Byb3RvY29sVmVyc2lvbhIOCgpDQVNUVjJfMV8wEAAiJQoLUGF5bG9hZFR5cGUSCgoGU1RSSU5HEAASCgoGQklOQVJZEAE='); +final $typed_data.Uint8List castMessageDescriptor = $convert.base64Decode( + 'CgtDYXN0TWVzc2FnZRJjChBwcm90b2NvbF92ZXJzaW9uGAEgAigOMjguZXh0ZW5zaW9ucy5hcG' + 'kuY2FzdF9jaGFubmVsLkNhc3RNZXNzYWdlLlByb3RvY29sVmVyc2lvblIPcHJvdG9jb2xWZXJz' + 'aW9uEhsKCXNvdXJjZV9pZBgCIAIoCVIIc291cmNlSWQSJQoOZGVzdGluYXRpb25faWQYAyACKA' + 'lSDWRlc3RpbmF0aW9uSWQSHAoJbmFtZXNwYWNlGAQgAigJUgluYW1lc3BhY2USVwoMcGF5bG9h' + 'ZF90eXBlGAUgAigOMjQuZXh0ZW5zaW9ucy5hcGkuY2FzdF9jaGFubmVsLkNhc3RNZXNzYWdlLl' + 'BheWxvYWRUeXBlUgtwYXlsb2FkVHlwZRIhCgxwYXlsb2FkX3V0ZjgYBiABKAlSC3BheWxvYWRV' + 'dGY4EiUKDnBheWxvYWRfYmluYXJ5GAcgASgMUg1wYXlsb2FkQmluYXJ5IiEKD1Byb3RvY29sVm' + 'Vyc2lvbhIOCgpDQVNUVjJfMV8wEAAiJQoLUGF5bG9hZFR5cGUSCgoGU1RSSU5HEAASCgoGQklO' + 'QVJZEAE='); + @$core.Deprecated('Use authChallengeDescriptor instead') -const AuthChallenge$json = const { +const AuthChallenge$json = { '1': 'AuthChallenge', }; /// Descriptor for `AuthChallenge`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List authChallengeDescriptor = $convert.base64Decode('Cg1BdXRoQ2hhbGxlbmdl'); +final $typed_data.Uint8List authChallengeDescriptor = + $convert.base64Decode('Cg1BdXRoQ2hhbGxlbmdl'); + @$core.Deprecated('Use authResponseDescriptor instead') -const AuthResponse$json = const { +const AuthResponse$json = { '1': 'AuthResponse', - '2': const [ - const {'1': 'signature', '3': 1, '4': 2, '5': 12, '10': 'signature'}, - const {'1': 'client_auth_certificate', '3': 2, '4': 2, '5': 12, '10': 'clientAuthCertificate'}, - const {'1': 'client_ca', '3': 3, '4': 3, '5': 12, '10': 'clientCa'}, + '2': [ + {'1': 'signature', '3': 1, '4': 2, '5': 12, '10': 'signature'}, + { + '1': 'client_auth_certificate', + '3': 2, + '4': 2, + '5': 12, + '10': 'clientAuthCertificate' + }, + {'1': 'client_ca', '3': 3, '4': 3, '5': 12, '10': 'clientCa'}, ], }; /// Descriptor for `AuthResponse`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List authResponseDescriptor = $convert.base64Decode('CgxBdXRoUmVzcG9uc2USHAoJc2lnbmF0dXJlGAEgAigMUglzaWduYXR1cmUSNgoXY2xpZW50X2F1dGhfY2VydGlmaWNhdGUYAiACKAxSFWNsaWVudEF1dGhDZXJ0aWZpY2F0ZRIbCgljbGllbnRfY2EYAyADKAxSCGNsaWVudENh'); +final $typed_data.Uint8List authResponseDescriptor = $convert.base64Decode( + 'CgxBdXRoUmVzcG9uc2USHAoJc2lnbmF0dXJlGAEgAigMUglzaWduYXR1cmUSNgoXY2xpZW50X2' + 'F1dGhfY2VydGlmaWNhdGUYAiACKAxSFWNsaWVudEF1dGhDZXJ0aWZpY2F0ZRIbCgljbGllbnRf' + 'Y2EYAyADKAxSCGNsaWVudENh'); + @$core.Deprecated('Use authErrorDescriptor instead') -const AuthError$json = const { +const AuthError$json = { '1': 'AuthError', - '2': const [ - const {'1': 'error_type', '3': 1, '4': 2, '5': 14, '6': '.extensions.api.cast_channel.AuthError.ErrorType', '10': 'errorType'}, + '2': [ + { + '1': 'error_type', + '3': 1, + '4': 2, + '5': 14, + '6': '.extensions.api.cast_channel.AuthError.ErrorType', + '10': 'errorType' + }, ], - '4': const [AuthError_ErrorType$json], + '4': [AuthError_ErrorType$json], }; @$core.Deprecated('Use authErrorDescriptor instead') -const AuthError_ErrorType$json = const { +const AuthError_ErrorType$json = { '1': 'ErrorType', - '2': const [ - const {'1': 'INTERNAL_ERROR', '2': 0}, - const {'1': 'NO_TLS', '2': 1}, + '2': [ + {'1': 'INTERNAL_ERROR', '2': 0}, + {'1': 'NO_TLS', '2': 1}, ], }; /// Descriptor for `AuthError`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List authErrorDescriptor = $convert.base64Decode('CglBdXRoRXJyb3ISTwoKZXJyb3JfdHlwZRgBIAIoDjIwLmV4dGVuc2lvbnMuYXBpLmNhc3RfY2hhbm5lbC5BdXRoRXJyb3IuRXJyb3JUeXBlUgllcnJvclR5cGUiKwoJRXJyb3JUeXBlEhIKDklOVEVSTkFMX0VSUk9SEAASCgoGTk9fVExTEAE='); +final $typed_data.Uint8List authErrorDescriptor = $convert.base64Decode( + 'CglBdXRoRXJyb3ISTwoKZXJyb3JfdHlwZRgBIAIoDjIwLmV4dGVuc2lvbnMuYXBpLmNhc3RfY2' + 'hhbm5lbC5BdXRoRXJyb3IuRXJyb3JUeXBlUgllcnJvclR5cGUiKwoJRXJyb3JUeXBlEhIKDklO' + 'VEVSTkFMX0VSUk9SEAASCgoGTk9fVExTEAE='); + @$core.Deprecated('Use deviceAuthMessageDescriptor instead') -const DeviceAuthMessage$json = const { +const DeviceAuthMessage$json = { '1': 'DeviceAuthMessage', - '2': const [ - const {'1': 'challenge', '3': 1, '4': 1, '5': 11, '6': '.extensions.api.cast_channel.AuthChallenge', '10': 'challenge'}, - const {'1': 'response', '3': 2, '4': 1, '5': 11, '6': '.extensions.api.cast_channel.AuthResponse', '10': 'response'}, - const {'1': 'error', '3': 3, '4': 1, '5': 11, '6': '.extensions.api.cast_channel.AuthError', '10': 'error'}, + '2': [ + { + '1': 'challenge', + '3': 1, + '4': 1, + '5': 11, + '6': '.extensions.api.cast_channel.AuthChallenge', + '10': 'challenge' + }, + { + '1': 'response', + '3': 2, + '4': 1, + '5': 11, + '6': '.extensions.api.cast_channel.AuthResponse', + '10': 'response' + }, + { + '1': 'error', + '3': 3, + '4': 1, + '5': 11, + '6': '.extensions.api.cast_channel.AuthError', + '10': 'error' + }, ], }; /// Descriptor for `DeviceAuthMessage`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List deviceAuthMessageDescriptor = $convert.base64Decode('ChFEZXZpY2VBdXRoTWVzc2FnZRJICgljaGFsbGVuZ2UYASABKAsyKi5leHRlbnNpb25zLmFwaS5jYXN0X2NoYW5uZWwuQXV0aENoYWxsZW5nZVIJY2hhbGxlbmdlEkUKCHJlc3BvbnNlGAIgASgLMikuZXh0ZW5zaW9ucy5hcGkuY2FzdF9jaGFubmVsLkF1dGhSZXNwb25zZVIIcmVzcG9uc2USPAoFZXJyb3IYAyABKAsyJi5leHRlbnNpb25zLmFwaS5jYXN0X2NoYW5uZWwuQXV0aEVycm9yUgVlcnJvcg=='); +final $typed_data.Uint8List deviceAuthMessageDescriptor = $convert.base64Decode( + 'ChFEZXZpY2VBdXRoTWVzc2FnZRJICgljaGFsbGVuZ2UYASABKAsyKi5leHRlbnNpb25zLmFwaS' + '5jYXN0X2NoYW5uZWwuQXV0aENoYWxsZW5nZVIJY2hhbGxlbmdlEkUKCHJlc3BvbnNlGAIgASgL' + 'MikuZXh0ZW5zaW9ucy5hcGkuY2FzdF9jaGFubmVsLkF1dGhSZXNwb25zZVIIcmVzcG9uc2USPA' + 'oFZXJyb3IYAyABKAsyJi5leHRlbnNpb25zLmFwaS5jYXN0X2NoYW5uZWwuQXV0aEVycm9yUgVl' + 'cnJvcg=='); diff --git a/lib/discovery_service.dart b/lib/discovery_service.dart index e85714b..e8b23a1 100644 --- a/lib/discovery_service.dart +++ b/lib/discovery_service.dart @@ -18,38 +18,32 @@ class CastDiscoveryService { final results = []; final discovery = BonsoirDiscovery(type: _domain); - await discovery.ready; + await discovery.initialize(); discovery.eventStream!.listen((event) { - if (event.type == BonsoirDiscoveryEventType.discoveryServiceFound) { - event.service?.resolve(discovery.serviceResolver); - } else if (event.type == BonsoirDiscoveryEventType.discoveryServiceResolved) { - if (event.service == null || event.service?.attributes == null) { - return; - } - - final port = event.service?.port; - final host = event.service?.toJson()['service.ip'] ?? event.service?.toJson()['service.host']; + if (event is BonsoirDiscoveryServiceFoundEvent) { + event.service.resolve(discovery.serviceResolver); + } else if (event is BonsoirDiscoveryServiceResolvedEvent) { + final port = event.service.port; + final host = event.service.toJson()['service.ip'] ?? event.service.toJson()['service.host']; String name = [ - event.service?.attributes?['md'], - event.service?.attributes?['fn'], + event.service.attributes['md'], + event.service.attributes['fn'], ].whereType().join(' - '); if (name.isEmpty) { - name = event.service!.name; + name = event.service.name; } - if (port == null || host == null) { - return; - } + if (host == null) return; results.add( CastDevice( - serviceName: event.service!.name, + serviceName: event.service.name, name: name, port: port, host: host, - extras: event.service!.attributes ?? {}, + extras: event.service.attributes, ), ); } diff --git a/pubspec.lock b/pubspec.lock index b4b97e4..31389e5 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,213 +1,320 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + sha256: c209688d9f5a5f26b2fb47a188131a6fb9e876ae9e47af3737c0b4f58a93470d + url: "https://pub.dev" + source: hosted + version: "91.0.0" + analyzer: + dependency: transitive + description: + name: analyzer + sha256: a40a0cee526a7e1f387c6847bd8a5ccbf510a75952ef8a28338e989558072cb0 + url: "https://pub.dev" + source: hosted + version: "8.4.0" args: dependency: transitive description: name: args - sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 + sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04 + url: "https://pub.dev" + source: hosted + version: "2.7.0" + async: + dependency: transitive + description: + name: async + sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb" url: "https://pub.dev" source: hosted - version: "2.4.2" + version: "2.13.0" bonsoir: dependency: "direct main" description: name: bonsoir - sha256: "800d77c0581fff06cc43ef2b7723dfe5ee9b899ab0fdf80fb1c7b8829a5deb5c" + sha256: "15de9d734708ccce1484ea9bbc750e364af88cb30fe6392368dc0cf233ddee5e" url: "https://pub.dev" source: hosted - version: "3.0.0+1" + version: "6.0.1" bonsoir_android: dependency: transitive description: name: bonsoir_android - sha256: "7207c36fd7e0f3c7c2d8cf353f02bd640d96e2387d575837f8ac051c9cbf4aa7" + sha256: e19728f94a0d9813abf9e2edf644fede008e58ef539865a1be86ac5d8994154e url: "https://pub.dev" source: hosted - version: "3.0.0+1" + version: "6.0.1" bonsoir_darwin: dependency: transitive description: name: bonsoir_darwin - sha256: "7211042c85da2d6efa80c0976bbd9568f2b63624097779847548ed4530675ade" + sha256: e242a03a019fd474be657715826cfc13e43d02c88e46ec5611a20b9d4f72854d url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "6.0.1" + bonsoir_linux: + dependency: transitive + description: + name: bonsoir_linux + sha256: "5f40f8fa6dc79245ddde38f4440bc0f49cd25ee6be04a4e56fe9fca0d2be7998" + url: "https://pub.dev" + source: hosted + version: "6.0.1" bonsoir_platform_interface: dependency: transitive description: name: bonsoir_platform_interface - sha256: "64d57cd52bd477b4891e9b9d419e6408da171ed9e0efc8aa716e7e343d5d93ad" + sha256: "3fa0c46b30eb2a2f48be6fa53591a5c0425bf00520be761b61763e58b51814ff" + url: "https://pub.dev" + source: hosted + version: "6.0.1" + bonsoir_windows: + dependency: transitive + description: + name: bonsoir_windows + sha256: "34c54802baaa2f00e3c4ab7ea46888f2a829876753778e2f40e3f273c3382d34" url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "6.0.1" characters: dependency: transitive description: name: characters - sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.4.0" collection: dependency: transitive description: name: collection - sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" url: "https://pub.dev" source: hosted - version: "1.18.0" - connectivity_plus: + version: "1.19.1" + convert: dependency: transitive description: - name: connectivity_plus - sha256: "77a180d6938f78ca7d2382d2240eb626c0f6a735d0bfdce227d8ffb80f95c48b" + name: convert + sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68 url: "https://pub.dev" source: hosted - version: "4.0.2" - connectivity_plus_platform_interface: + version: "3.1.2" + crypto: dependency: transitive description: - name: connectivity_plus_platform_interface - sha256: cf1d1c28f4416f8c654d7dc3cd638ec586076255d407cef3ddbdaf178272a71a + name: crypto + sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855" url: "https://pub.dev" source: hosted - version: "1.2.4" + version: "3.0.6" + dart_style: + dependency: transitive + description: + name: dart_style + sha256: c87dfe3d56f183ffe9106a18aebc6db431fc7c98c31a54b952a77f3d54a85697 + url: "https://pub.dev" + source: hosted + version: "3.1.2" dbus: dependency: transitive description: name: dbus - sha256: "6f07cba3f7b3448d42d015bfd3d53fe12e5b36da2423f23838efc1d5fb31a263" + sha256: "79e0c23480ff85dc68de79e2cd6334add97e48f7f4865d17686dd6ea81a47e8c" url: "https://pub.dev" source: hosted - version: "0.7.8" + version: "0.7.11" ffi: dependency: transitive description: name: ffi - sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878" + sha256: "289279317b4b16eb2bb7e271abccd4bf84ec9bdcbe999e278a94b804f5630418" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + file: + dependency: transitive + description: + name: file + sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "7.0.1" fixnum: dependency: transitive description: name: fixnum - sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1" + sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.1.1" flutter: dependency: "direct main" description: flutter source: sdk version: "0.0.0" - flutter_web_plugins: - dependency: transitive - description: flutter - source: sdk - version: "0.0.0" - js: + glob: dependency: transitive description: - name: js - sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + name: glob + sha256: c3f1ee72c96f8f78935e18aa8cecced9ab132419e8625dc187e1c2408efc20de url: "https://pub.dev" source: hosted - version: "0.6.7" + version: "2.1.3" + lints: + dependency: "direct dev" + description: + name: lints + sha256: a5e2b223cb7c9c8efdc663ef484fdd95bb243bff242ef5b13e26883547fce9a0 + url: "https://pub.dev" + source: hosted + version: "6.0.0" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec url: "https://pub.dev" source: hosted - version: "0.8.0" + version: "0.11.1" meta: dependency: transitive description: name: meta - sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" + sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c url: "https://pub.dev" source: hosted - version: "1.12.0" - nm: + version: "1.16.0" + package_config: dependency: transitive description: - name: nm - sha256: "2c9aae4127bdc8993206464fcc063611e0e36e72018696cd9631023a31b24254" + name: package_config + sha256: f096c55ebb7deb7e384101542bfba8c52696c1b56fca2eb62827989ef2353bbc url: "https://pub.dev" source: hosted - version: "0.5.0" + version: "2.2.0" path: dependency: transitive description: name: path - sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" - url: "https://pub.dev" - source: hosted - version: "1.8.3" - pedantic: - dependency: "direct dev" - description: - name: pedantic - sha256: "67fc27ed9639506c856c840ccce7594d0bdcd91bc8d53d6e52359449a1d50602" + sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" url: "https://pub.dev" source: hosted - version: "1.11.1" + version: "1.9.1" petitparser: dependency: transitive description: name: petitparser - sha256: cb3798bef7fc021ac45b308f4b51208a152792445cce0448c9a4ba5879dd8750 + sha256: "1a97266a94f7350d30ae522c0af07890c70b8e62c71e8e3920d1db4d23c057d1" url: "https://pub.dev" source: hosted - version: "5.4.0" + version: "7.0.1" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - sha256: da3fdfeccc4d4ff2da8f8c556704c08f912542c5fb3cf2233ed75372384a034d + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" url: "https://pub.dev" source: hosted - version: "2.1.6" + version: "2.1.8" protobuf: dependency: "direct main" description: name: protobuf - sha256: "68645b24e0716782e58948f8467fd42a880f255096a821f9e7d0ec625b00c84d" + sha256: "826d6a306be26f29e5cd9faeb0c97aad5897270341dab6dbd7b8acd675937006" url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "5.0.0" protoc_plugin: dependency: "direct dev" description: name: protoc_plugin - sha256: fb0554851c9eca30bd18405fbbfe81e39166d4a2f0e5b770606fd69da3da0b2f + sha256: c3893590d5b81345dfd4daa25c1890092667983fd4374bb6671b2a9a481d8359 + url: "https://pub.dev" + source: hosted + version: "23.0.0" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "5bfcf68ca79ef689f8990d1160781b4bad40a3bd5e5218ad4076ddb7f4081585" url: "https://pub.dev" source: hosted - version: "21.1.2" + version: "2.2.0" sky_engine: dependency: transitive description: flutter source: sdk - version: "0.0.99" + version: "0.0.0" + source_span: + dependency: transitive + description: + name: source_span + sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" + url: "https://pub.dev" + source: hosted + version: "1.10.1" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" + url: "https://pub.dev" + source: hosted + version: "1.4.1" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" + url: "https://pub.dev" + source: hosted + version: "1.2.2" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 + url: "https://pub.dev" + source: hosted + version: "1.4.0" vector_math: dependency: transitive description: name: vector_math - sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.2.0" + watcher: + dependency: transitive + description: + name: watcher + sha256: "592ab6e2892f67760543fb712ff0177f4ec76c031f02f5b4ff8d3fc5eb9fb61a" + url: "https://pub.dev" + source: hosted + version: "1.1.4" xml: dependency: transitive description: name: xml - sha256: "5bc72e1e45e941d825fd7468b9b4cc3b9327942649aeb6fc5cdbf135f0a86e84" + sha256: "971043b3a0d3da28727e40ed3e0b5d18b742fa5a68665cca88e74b7876d5e025" + url: "https://pub.dev" + source: hosted + version: "6.6.1" + yaml: + dependency: transitive + description: + name: yaml + sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce url: "https://pub.dev" source: hosted - version: "6.3.0" + version: "3.1.3" sdks: - dart: ">=3.3.0-0 <4.0.0" + dart: ">=3.9.0 <4.0.0" flutter: ">=3.7.0" diff --git a/pubspec.yaml b/pubspec.yaml index 260b372..2a2f116 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,17 +1,17 @@ name: cast description: Dart package to discover and connect with Chromecast devices -version: 2.1.0 +version: 2.2.0 homepage: https://github.com/johnvuko/flutter_cast environment: - sdk: '>=3.1.3 <4.0.0' + sdk: ">=3.1.3 <4.0.0" dependencies: - bonsoir: '>=3.0.0' + bonsoir: ^6.0.1 flutter: sdk: flutter - protobuf: ^3.1.0 + protobuf: ^5.0.0 dev_dependencies: - pedantic: ^1.11.1 - protoc_plugin: ^21.1.2 + lints: ^6.0.0 + protoc_plugin: ^23.0.0