diff --git a/.gitignore b/.gitignore index 18f5bc9..2250541 100644 --- a/.gitignore +++ b/.gitignore @@ -45,3 +45,4 @@ app.*.map.json /pubspec.lock /rust/target/ /rust/Cargo.lock +/rust_builder/ diff --git a/flutter_rust_bridge.yaml b/flutter_rust_bridge.yaml new file mode 100644 index 0000000..782eba5 --- /dev/null +++ b/flutter_rust_bridge.yaml @@ -0,0 +1,2 @@ +rust_input: rust/src/api/**/*.rs +dart_output: lib/common/rust/ \ No newline at end of file diff --git a/lib/api/api.dart b/lib/api/api.dart index df6ebbb..fc8d4fb 100644 --- a/lib/api/api.dart +++ b/lib/api/api.dart @@ -36,8 +36,8 @@ class Api { static Future> getAppReleaseDataByVersionName( String version) async { - final r = await dio - .get("${URLConf.gitlabApiPath}/repos/SCToolBox/Release/releases/tags/$version"); + final r = await dio.get( + "${URLConf.gitlabApiPath}/repos/SCToolBox/Release/releases/tags/$version"); return r.data; } diff --git a/lib/base/ui_model.dart b/lib/base/ui_model.dart index fadb55a..407ffad 100644 --- a/lib/base/ui_model.dart +++ b/lib/base/ui_model.dart @@ -112,8 +112,9 @@ class BaseUIModel extends ChangeNotifier { return _childUIProviders![modelKey]!; } - T? getCreatedChildUIModel(String modelKey,{bool create = false}) { - if (create && _childUIModels?[modelKey] == null) { + T? getCreatedChildUIModel(String modelKey, + {bool create = false}) { + if (create && _childUIModels?[modelKey] == null) { _getChildUIModel(modelKey); } return _childUIModels?[modelKey] as T?; diff --git a/lib/common/conf/app_conf.dart b/lib/common/conf/app_conf.dart index 91edc84..405af65 100644 --- a/lib/common/conf/app_conf.dart +++ b/lib/common/conf/app_conf.dart @@ -8,14 +8,13 @@ import 'package:path_provider/path_provider.dart'; import 'package:starcitizen_doctor/api/analytics.dart'; import 'package:starcitizen_doctor/api/api.dart'; import 'package:starcitizen_doctor/common/helper/system_helper.dart'; -import 'package:starcitizen_doctor/common/rust/ffi.dart'; +import 'package:starcitizen_doctor/common/rust/frb_generated.dart'; import 'package:starcitizen_doctor/data/app_version_data.dart'; import 'package:starcitizen_doctor/global_ui_model.dart'; +import 'package:starcitizen_doctor/base/ui.dart'; import 'package:uuid/uuid.dart'; import 'package:window_manager/window_manager.dart'; -import '../../base/ui.dart'; - class AppConf { static const String appVersion = "2.10.3 Beta"; static const int appVersionCode = 38; @@ -67,10 +66,7 @@ class AppConf { } /// check Rust bridge - if (await rustFii.ping() != "PONG") { - dPrint("Rust bridge Error"); - exit(1); - } + await RustLib.init(); dPrint("---- rust bridge inited -----"); await SystemHelper.initPowershellPath(); diff --git a/lib/common/rust/api/downloader_api.dart b/lib/common/rust/api/downloader_api.dart new file mode 100644 index 0000000..efbf26f --- /dev/null +++ b/lib/common/rust/api/downloader_api.dart @@ -0,0 +1,24 @@ +// This file is automatically generated, so please do not edit it. +// Generated by `flutter_rust_bridge`@ 2.0.0-dev.23. + +// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import + +import '../downloader.dart'; +import '../frb_generated.dart'; +import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; + +Stream startDownload( + {required String url, + required String savePath, + required String fileName, + required int connectionCount, + dynamic hint}) => + RustLib.instance.api.startDownload( + url: url, + savePath: savePath, + fileName: fileName, + connectionCount: connectionCount, + hint: hint); + +Future cancelDownload({required String id, dynamic hint}) => + RustLib.instance.api.cancelDownload(id: id, hint: hint); diff --git a/lib/common/rust/bridge_definitions.dart b/lib/common/rust/bridge_definitions.dart deleted file mode 100644 index 3022740..0000000 --- a/lib/common/rust/bridge_definitions.dart +++ /dev/null @@ -1,67 +0,0 @@ -// AUTO GENERATED FILE, DO NOT EDIT. -// Generated by `flutter_rust_bridge`@ 1.82.3. -// ignore_for_file: non_constant_identifier_names, unused_element, duplicate_ignore, directives_ordering, curly_braces_in_flow_control_structures, unnecessary_lambdas, slash_for_doc_comments, prefer_const_literals_to_create_immutables, implicit_dynamic_list_literal, duplicate_import, unused_import, unnecessary_import, prefer_single_quotes, prefer_const_constructors, use_super_parameters, always_use_package_imports, annotate_overrides, invalid_use_of_protected_member, constant_identifier_names, invalid_use_of_internal_member, prefer_is_empty, unnecessary_const - -import 'dart:convert'; -import 'dart:async'; -import 'package:meta/meta.dart'; -import 'package:flutter_rust_bridge/flutter_rust_bridge.dart'; -import 'package:uuid/uuid.dart'; -import 'package:freezed_annotation/freezed_annotation.dart' hide protected; - -part 'bridge_definitions.freezed.dart'; - -abstract class Rust { - Future ping({dynamic hint}); - - FlutterRustBridgeTaskConstMeta get kPingConstMeta; - - Stream startDownload( - {required String url, - required String savePath, - required String fileName, - required int connectionCount, - dynamic hint}); - - FlutterRustBridgeTaskConstMeta get kStartDownloadConstMeta; - - Future cancelDownload({required String id, dynamic hint}); - - FlutterRustBridgeTaskConstMeta get kCancelDownloadConstMeta; -} - -class DownloadCallbackData { - final String id; - final int total; - final int progress; - final int speed; - final MyDownloaderStatus status; - - const DownloadCallbackData({ - required this.id, - required this.total, - required this.progress, - required this.speed, - required this.status, - }); -} - -@freezed -sealed class MyDownloaderStatus with _$MyDownloaderStatus { - const factory MyDownloaderStatus.noStart() = MyDownloaderStatus_NoStart; - const factory MyDownloaderStatus.running() = MyDownloaderStatus_Running; - const factory MyDownloaderStatus.pending( - MyNetworkItemPendingType field0, - ) = MyDownloaderStatus_Pending; - const factory MyDownloaderStatus.error( - String field0, - ) = MyDownloaderStatus_Error; - const factory MyDownloaderStatus.finished() = MyDownloaderStatus_Finished; -} - -enum MyNetworkItemPendingType { - QueueUp, - Starting, - Stopping, - Initializing, -} diff --git a/lib/common/rust/bridge_generated.dart b/lib/common/rust/bridge_generated.dart deleted file mode 100644 index c83be4b..0000000 --- a/lib/common/rust/bridge_generated.dart +++ /dev/null @@ -1,382 +0,0 @@ -// AUTO GENERATED FILE, DO NOT EDIT. -// Generated by `flutter_rust_bridge`@ 1.82.3. -// ignore_for_file: non_constant_identifier_names, unused_element, duplicate_ignore, directives_ordering, curly_braces_in_flow_control_structures, unnecessary_lambdas, slash_for_doc_comments, prefer_const_literals_to_create_immutables, implicit_dynamic_list_literal, duplicate_import, unused_import, unnecessary_import, prefer_single_quotes, prefer_const_constructors, use_super_parameters, always_use_package_imports, annotate_overrides, invalid_use_of_protected_member, constant_identifier_names, invalid_use_of_internal_member, prefer_is_empty, unnecessary_const - -import "bridge_definitions.dart"; -import 'dart:convert'; -import 'dart:async'; -import 'package:meta/meta.dart'; -import 'package:flutter_rust_bridge/flutter_rust_bridge.dart'; -import 'package:uuid/uuid.dart'; - -import 'dart:convert'; -import 'dart:async'; -import 'package:meta/meta.dart'; -import 'package:flutter_rust_bridge/flutter_rust_bridge.dart'; -import 'package:uuid/uuid.dart'; - -import 'dart:ffi' as ffi; - -class RustImpl implements Rust { - final RustPlatform _platform; - factory RustImpl(ExternalLibrary dylib) => RustImpl.raw(RustPlatform(dylib)); - - /// Only valid on web/WASM platforms. - factory RustImpl.wasm(FutureOr module) => - RustImpl(module as ExternalLibrary); - RustImpl.raw(this._platform); - Future ping({dynamic hint}) { - return _platform.executeNormal(FlutterRustBridgeTask( - callFfi: (port_) => _platform.inner.wire_ping(port_), - parseSuccessData: _wire2api_String, - parseErrorData: null, - constMeta: kPingConstMeta, - argValues: [], - hint: hint, - )); - } - - FlutterRustBridgeTaskConstMeta get kPingConstMeta => - const FlutterRustBridgeTaskConstMeta( - debugName: "ping", - argNames: [], - ); - - Stream startDownload( - {required String url, - required String savePath, - required String fileName, - required int connectionCount, - dynamic hint}) { - var arg0 = _platform.api2wire_String(url); - var arg1 = _platform.api2wire_String(savePath); - var arg2 = _platform.api2wire_String(fileName); - var arg3 = api2wire_u8(connectionCount); - return _platform.executeStream(FlutterRustBridgeTask( - callFfi: (port_) => - _platform.inner.wire_start_download(port_, arg0, arg1, arg2, arg3), - parseSuccessData: _wire2api_download_callback_data, - parseErrorData: null, - constMeta: kStartDownloadConstMeta, - argValues: [url, savePath, fileName, connectionCount], - hint: hint, - )); - } - - FlutterRustBridgeTaskConstMeta get kStartDownloadConstMeta => - const FlutterRustBridgeTaskConstMeta( - debugName: "start_download", - argNames: ["url", "savePath", "fileName", "connectionCount"], - ); - - Future cancelDownload({required String id, dynamic hint}) { - var arg0 = _platform.api2wire_String(id); - return _platform.executeNormal(FlutterRustBridgeTask( - callFfi: (port_) => _platform.inner.wire_cancel_download(port_, arg0), - parseSuccessData: _wire2api_unit, - parseErrorData: null, - constMeta: kCancelDownloadConstMeta, - argValues: [id], - hint: hint, - )); - } - - FlutterRustBridgeTaskConstMeta get kCancelDownloadConstMeta => - const FlutterRustBridgeTaskConstMeta( - debugName: "cancel_download", - argNames: ["id"], - ); - - void dispose() { - _platform.dispose(); - } -// Section: wire2api - - String _wire2api_String(dynamic raw) { - return raw as String; - } - - DownloadCallbackData _wire2api_download_callback_data(dynamic raw) { - final arr = raw as List; - if (arr.length != 5) - throw Exception('unexpected arr length: expect 5 but see ${arr.length}'); - return DownloadCallbackData( - id: _wire2api_String(arr[0]), - total: _wire2api_u64(arr[1]), - progress: _wire2api_u64(arr[2]), - speed: _wire2api_u64(arr[3]), - status: _wire2api_my_downloader_status(arr[4]), - ); - } - - int _wire2api_i32(dynamic raw) { - return raw as int; - } - - MyDownloaderStatus _wire2api_my_downloader_status(dynamic raw) { - switch (raw[0]) { - case 0: - return MyDownloaderStatus_NoStart(); - case 1: - return MyDownloaderStatus_Running(); - case 2: - return MyDownloaderStatus_Pending( - _wire2api_my_network_item_pending_type(raw[1]), - ); - case 3: - return MyDownloaderStatus_Error( - _wire2api_String(raw[1]), - ); - case 4: - return MyDownloaderStatus_Finished(); - default: - throw Exception("unreachable"); - } - } - - MyNetworkItemPendingType _wire2api_my_network_item_pending_type(dynamic raw) { - return MyNetworkItemPendingType.values[raw as int]; - } - - int _wire2api_u64(dynamic raw) { - return castInt(raw); - } - - int _wire2api_u8(dynamic raw) { - return raw as int; - } - - Uint8List _wire2api_uint_8_list(dynamic raw) { - return raw as Uint8List; - } - - void _wire2api_unit(dynamic raw) { - return; - } -} - -// Section: api2wire - -@protected -int api2wire_u8(int raw) { - return raw; -} - -// Section: finalizer - -class RustPlatform extends FlutterRustBridgeBase { - RustPlatform(ffi.DynamicLibrary dylib) : super(RustWire(dylib)); - -// Section: api2wire - - @protected - ffi.Pointer api2wire_String(String raw) { - return api2wire_uint_8_list(utf8.encoder.convert(raw)); - } - - @protected - ffi.Pointer api2wire_uint_8_list(Uint8List raw) { - final ans = inner.new_uint_8_list_0(raw.length); - ans.ref.ptr.asTypedList(raw.length).setAll(0, raw); - return ans; - } -// Section: finalizer - -// Section: api_fill_to_wire -} - -// ignore_for_file: camel_case_types, non_constant_identifier_names, avoid_positional_boolean_parameters, annotate_overrides, constant_identifier_names - -// AUTO GENERATED FILE, DO NOT EDIT. -// -// Generated by `package:ffigen`. -// ignore_for_file: type=lint - -/// generated by flutter_rust_bridge -class RustWire implements FlutterRustBridgeWireBase { - @internal - late final dartApi = DartApiDl(init_frb_dart_api_dl); - - /// Holds the symbol lookup function. - final ffi.Pointer Function(String symbolName) - _lookup; - - /// The symbols are looked up in [dynamicLibrary]. - RustWire(ffi.DynamicLibrary dynamicLibrary) : _lookup = dynamicLibrary.lookup; - - /// The symbols are looked up with [lookup]. - RustWire.fromLookup( - ffi.Pointer Function(String symbolName) - lookup) - : _lookup = lookup; - - void store_dart_post_cobject( - DartPostCObjectFnType ptr, - ) { - return _store_dart_post_cobject( - ptr, - ); - } - - late final _store_dart_post_cobjectPtr = - _lookup>( - 'store_dart_post_cobject'); - late final _store_dart_post_cobject = _store_dart_post_cobjectPtr - .asFunction(); - - Object get_dart_object( - int ptr, - ) { - return _get_dart_object( - ptr, - ); - } - - late final _get_dart_objectPtr = - _lookup>( - 'get_dart_object'); - late final _get_dart_object = - _get_dart_objectPtr.asFunction(); - - void drop_dart_object( - int ptr, - ) { - return _drop_dart_object( - ptr, - ); - } - - late final _drop_dart_objectPtr = - _lookup>( - 'drop_dart_object'); - late final _drop_dart_object = - _drop_dart_objectPtr.asFunction(); - - int new_dart_opaque( - Object handle, - ) { - return _new_dart_opaque( - handle, - ); - } - - late final _new_dart_opaquePtr = - _lookup>( - 'new_dart_opaque'); - late final _new_dart_opaque = - _new_dart_opaquePtr.asFunction(); - - int init_frb_dart_api_dl( - ffi.Pointer obj, - ) { - return _init_frb_dart_api_dl( - obj, - ); - } - - late final _init_frb_dart_api_dlPtr = - _lookup)>>( - 'init_frb_dart_api_dl'); - late final _init_frb_dart_api_dl = _init_frb_dart_api_dlPtr - .asFunction)>(); - - void wire_ping( - int port_, - ) { - return _wire_ping( - port_, - ); - } - - late final _wire_pingPtr = - _lookup>('wire_ping'); - late final _wire_ping = _wire_pingPtr.asFunction(); - - void wire_start_download( - int port_, - ffi.Pointer url, - ffi.Pointer save_path, - ffi.Pointer file_name, - int connection_count, - ) { - return _wire_start_download( - port_, - url, - save_path, - file_name, - connection_count, - ); - } - - late final _wire_start_downloadPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Int64, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Uint8)>>('wire_start_download'); - late final _wire_start_download = _wire_start_downloadPtr.asFunction< - void Function(int, ffi.Pointer, - ffi.Pointer, ffi.Pointer, int)>(); - - void wire_cancel_download( - int port_, - ffi.Pointer id, - ) { - return _wire_cancel_download( - port_, - id, - ); - } - - late final _wire_cancel_downloadPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Int64, - ffi.Pointer)>>('wire_cancel_download'); - late final _wire_cancel_download = _wire_cancel_downloadPtr - .asFunction)>(); - - ffi.Pointer new_uint_8_list_0( - int len, - ) { - return _new_uint_8_list_0( - len, - ); - } - - late final _new_uint_8_list_0Ptr = _lookup< - ffi - .NativeFunction Function(ffi.Int32)>>( - 'new_uint_8_list_0'); - late final _new_uint_8_list_0 = _new_uint_8_list_0Ptr - .asFunction Function(int)>(); - - void free_WireSyncReturn( - WireSyncReturn ptr, - ) { - return _free_WireSyncReturn( - ptr, - ); - } - - late final _free_WireSyncReturnPtr = - _lookup>( - 'free_WireSyncReturn'); - late final _free_WireSyncReturn = - _free_WireSyncReturnPtr.asFunction(); -} - -final class _Dart_Handle extends ffi.Opaque {} - -final class wire_uint_8_list extends ffi.Struct { - external ffi.Pointer ptr; - - @ffi.Int32() - external int len; -} - -typedef DartPostCObjectFnType = ffi.Pointer< - ffi.NativeFunction< - ffi.Bool Function(DartPort port_id, ffi.Pointer message)>>; -typedef DartPort = ffi.Int64; diff --git a/lib/common/rust/downloader.dart b/lib/common/rust/downloader.dart new file mode 100644 index 0000000..df00778 --- /dev/null +++ b/lib/common/rust/downloader.dart @@ -0,0 +1,64 @@ +// This file is automatically generated, so please do not edit it. +// Generated by `flutter_rust_bridge`@ 2.0.0-dev.23. + +// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import + +import 'frb_generated.dart'; +import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; +import 'package:freezed_annotation/freezed_annotation.dart' hide protected; +part 'downloader.freezed.dart'; + +class DownloadCallbackData { + final String id; + final int total; + final int progress; + final int speed; + final MyDownloaderStatus status; + + const DownloadCallbackData({ + required this.id, + required this.total, + required this.progress, + required this.speed, + required this.status, + }); + + @override + int get hashCode => + id.hashCode ^ + total.hashCode ^ + progress.hashCode ^ + speed.hashCode ^ + status.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is DownloadCallbackData && + runtimeType == other.runtimeType && + id == other.id && + total == other.total && + progress == other.progress && + speed == other.speed && + status == other.status; +} + +@freezed +sealed class MyDownloaderStatus with _$MyDownloaderStatus { + const factory MyDownloaderStatus.noStart() = MyDownloaderStatus_NoStart; + const factory MyDownloaderStatus.running() = MyDownloaderStatus_Running; + const factory MyDownloaderStatus.pending( + MyNetworkItemPendingType field0, + ) = MyDownloaderStatus_Pending; + const factory MyDownloaderStatus.error( + String field0, + ) = MyDownloaderStatus_Error; + const factory MyDownloaderStatus.finished() = MyDownloaderStatus_Finished; +} + +enum MyNetworkItemPendingType { + queueUp, + starting, + stopping, + initializing, +} diff --git a/lib/common/rust/bridge_definitions.freezed.dart b/lib/common/rust/downloader.freezed.dart similarity index 99% rename from lib/common/rust/bridge_definitions.freezed.dart rename to lib/common/rust/downloader.freezed.dart index b47427b..7054911 100644 --- a/lib/common/rust/bridge_definitions.freezed.dart +++ b/lib/common/rust/downloader.freezed.dart @@ -3,7 +3,7 @@ // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark -part of 'bridge_definitions.dart'; +part of 'downloader.dart'; // ************************************************************************** // FreezedGenerator @@ -122,7 +122,7 @@ class _$MyDownloaderStatus_NoStartImpl implements MyDownloaderStatus_NoStart { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && other is _$MyDownloaderStatus_NoStartImpl); @@ -246,7 +246,7 @@ class _$MyDownloaderStatus_RunningImpl implements MyDownloaderStatus_Running { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && other is _$MyDownloaderStatus_RunningImpl); @@ -388,7 +388,7 @@ class _$MyDownloaderStatus_PendingImpl implements MyDownloaderStatus_Pending { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && other is _$MyDownloaderStatus_PendingImpl && @@ -544,7 +544,7 @@ class _$MyDownloaderStatus_ErrorImpl implements MyDownloaderStatus_Error { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && other is _$MyDownloaderStatus_ErrorImpl && @@ -682,7 +682,7 @@ class _$MyDownloaderStatus_FinishedImpl implements MyDownloaderStatus_Finished { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && other is _$MyDownloaderStatus_FinishedImpl); diff --git a/lib/common/rust/ffi.dart b/lib/common/rust/ffi.dart deleted file mode 100644 index 7bc8d8a..0000000 --- a/lib/common/rust/ffi.dart +++ /dev/null @@ -1,23 +0,0 @@ -// This file initializes the dynamic library and connects it with the stub -// generated by flutter_rust_bridge_codegen. - -import 'dart:ffi'; - -import 'bridge_generated.dart'; -import 'bridge_definitions.dart'; -export 'bridge_definitions.dart'; - -// Re-export the bridge so it is only necessary to import this file. -export 'bridge_generated.dart'; -import 'dart:io' as io; - - -const _base = 'rust'; - -// On MacOS, the dynamic library is not bundled with the binary, -// but rather directly **linked** against the binary. -final _dylib = io.Platform.isWindows ? '$_base.dll' : 'lib$_base.so'; - -final Rust rustFii = RustImpl(io.Platform.isIOS || io.Platform.isMacOS - ? DynamicLibrary.executable() - : DynamicLibrary.open(_dylib)); diff --git a/lib/common/rust/frb_generated.dart b/lib/common/rust/frb_generated.dart new file mode 100644 index 0000000..e3cd198 --- /dev/null +++ b/lib/common/rust/frb_generated.dart @@ -0,0 +1,395 @@ +// This file is automatically generated, so please do not edit it. +// Generated by `flutter_rust_bridge`@ 2.0.0-dev.23. + +// ignore_for_file: unused_import, unused_element, unnecessary_import, duplicate_ignore, invalid_use_of_internal_member, annotate_overrides, non_constant_identifier_names, curly_braces_in_flow_control_structures, prefer_const_literals_to_create_immutables, unused_field + +import 'api/downloader_api.dart'; +import 'dart:async'; +import 'dart:convert'; +import 'downloader.dart'; +import 'frb_generated.io.dart' if (dart.library.html) 'frb_generated.web.dart'; +import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; + +/// Main entrypoint of the Rust API +class RustLib extends BaseEntrypoint { + @internal + static final instance = RustLib._(); + + RustLib._(); + + /// Initialize flutter_rust_bridge + static Future init({ + RustLibApi? api, + BaseHandler? handler, + ExternalLibrary? externalLibrary, + }) async { + await instance.initImpl( + api: api, + handler: handler, + externalLibrary: externalLibrary, + ); + } + + /// Dispose flutter_rust_bridge + /// + /// The call to this function is optional, since flutter_rust_bridge (and everything else) + /// is automatically disposed when the app stops. + static void dispose() => instance.disposeImpl(); + + @override + ApiImplConstructor get apiImplConstructor => + RustLibApiImpl.new; + + @override + WireConstructor get wireConstructor => + RustLibWire.fromExternalLibrary; + + @override + Future executeRustInitializers() async {} + + @override + ExternalLibraryLoaderConfig get defaultExternalLibraryLoaderConfig => + kDefaultExternalLibraryLoaderConfig; + + @override + String get codegenVersion => '2.0.0-dev.23'; + + static const kDefaultExternalLibraryLoaderConfig = + ExternalLibraryLoaderConfig( + stem: 'rust_lib', + ioDirectory: 'rust/target/release/', + webPrefix: 'pkg/', + ); +} + +abstract class RustLibApi extends BaseApi { + Future cancelDownload({required String id, dynamic hint}); + + Stream startDownload( + {required String url, + required String savePath, + required String fileName, + required int connectionCount, + dynamic hint}); +} + +class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { + RustLibApiImpl({ + required super.handler, + required super.wire, + required super.generalizedFrbRustBinding, + required super.portManager, + }); + + @override + Future cancelDownload({required String id, dynamic hint}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(id, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 2, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_unit, + decodeErrorData: null, + ), + constMeta: kCancelDownloadConstMeta, + argValues: [id], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kCancelDownloadConstMeta => const TaskConstMeta( + debugName: "cancel_download", + argNames: ["id"], + ); + + @override + Stream startDownload( + {required String url, + required String savePath, + required String fileName, + required int connectionCount, + dynamic hint}) { + return handler.executeStream(StreamTask( + callFfi: (port_) { + final serializer = SseSerializer(generalizedFrbRustBinding); + sse_encode_String(url, serializer); + sse_encode_String(savePath, serializer); + sse_encode_String(fileName, serializer); + sse_encode_u_8(connectionCount, serializer); + pdeCallFfi(generalizedFrbRustBinding, serializer, + funcId: 1, port: port_); + }, + codec: SseCodec( + decodeSuccessData: sse_decode_download_callback_data, + decodeErrorData: null, + ), + constMeta: kStartDownloadConstMeta, + argValues: [url, savePath, fileName, connectionCount], + apiImpl: this, + hint: hint, + )); + } + + TaskConstMeta get kStartDownloadConstMeta => const TaskConstMeta( + debugName: "start_download", + argNames: ["url", "savePath", "fileName", "connectionCount"], + ); + + @protected + String dco_decode_String(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw as String; + } + + @protected + DownloadCallbackData dco_decode_download_callback_data(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + final arr = raw as List; + if (arr.length != 5) + throw Exception('unexpected arr length: expect 5 but see ${arr.length}'); + return DownloadCallbackData( + id: dco_decode_String(arr[0]), + total: dco_decode_u_64(arr[1]), + progress: dco_decode_u_64(arr[2]), + speed: dco_decode_u_64(arr[3]), + status: dco_decode_my_downloader_status(arr[4]), + ); + } + + @protected + int dco_decode_i_32(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw as int; + } + + @protected + Uint8List dco_decode_list_prim_u_8_strict(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw as Uint8List; + } + + @protected + MyDownloaderStatus dco_decode_my_downloader_status(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + switch (raw[0]) { + case 0: + return MyDownloaderStatus_NoStart(); + case 1: + return MyDownloaderStatus_Running(); + case 2: + return MyDownloaderStatus_Pending( + dco_decode_my_network_item_pending_type(raw[1]), + ); + case 3: + return MyDownloaderStatus_Error( + dco_decode_String(raw[1]), + ); + case 4: + return MyDownloaderStatus_Finished(); + default: + throw Exception("unreachable"); + } + } + + @protected + MyNetworkItemPendingType dco_decode_my_network_item_pending_type( + dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return MyNetworkItemPendingType.values[raw as int]; + } + + @protected + int dco_decode_u_64(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dcoDecodeI64OrU64(raw); + } + + @protected + int dco_decode_u_8(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return raw as int; + } + + @protected + void dco_decode_unit(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return; + } + + @protected + String sse_decode_String(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var inner = sse_decode_list_prim_u_8_strict(deserializer); + return utf8.decoder.convert(inner); + } + + @protected + DownloadCallbackData sse_decode_download_callback_data( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_id = sse_decode_String(deserializer); + var var_total = sse_decode_u_64(deserializer); + var var_progress = sse_decode_u_64(deserializer); + var var_speed = sse_decode_u_64(deserializer); + var var_status = sse_decode_my_downloader_status(deserializer); + return DownloadCallbackData( + id: var_id, + total: var_total, + progress: var_progress, + speed: var_speed, + status: var_status); + } + + @protected + int sse_decode_i_32(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return deserializer.buffer.getInt32(); + } + + @protected + Uint8List sse_decode_list_prim_u_8_strict(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var len_ = sse_decode_i_32(deserializer); + return deserializer.buffer.getUint8List(len_); + } + + @protected + MyDownloaderStatus sse_decode_my_downloader_status( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + + var tag_ = sse_decode_i_32(deserializer); + switch (tag_) { + case 0: + return MyDownloaderStatus_NoStart(); + case 1: + return MyDownloaderStatus_Running(); + case 2: + var var_field0 = sse_decode_my_network_item_pending_type(deserializer); + return MyDownloaderStatus_Pending(var_field0); + case 3: + var var_field0 = sse_decode_String(deserializer); + return MyDownloaderStatus_Error(var_field0); + case 4: + return MyDownloaderStatus_Finished(); + default: + throw UnimplementedError(''); + } + } + + @protected + MyNetworkItemPendingType sse_decode_my_network_item_pending_type( + SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var inner = sse_decode_i_32(deserializer); + return MyNetworkItemPendingType.values[inner]; + } + + @protected + int sse_decode_u_64(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return deserializer.buffer.getUint64(); + } + + @protected + int sse_decode_u_8(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return deserializer.buffer.getUint8(); + } + + @protected + void sse_decode_unit(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + } + + @protected + bool sse_decode_bool(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return deserializer.buffer.getUint8() != 0; + } + + @protected + void sse_encode_String(String self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_list_prim_u_8_strict(utf8.encoder.convert(self), serializer); + } + + @protected + void sse_encode_download_callback_data( + DownloadCallbackData self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_String(self.id, serializer); + sse_encode_u_64(self.total, serializer); + sse_encode_u_64(self.progress, serializer); + sse_encode_u_64(self.speed, serializer); + sse_encode_my_downloader_status(self.status, serializer); + } + + @protected + void sse_encode_i_32(int self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + serializer.buffer.putInt32(self); + } + + @protected + void sse_encode_list_prim_u_8_strict( + Uint8List self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_i_32(self.length, serializer); + serializer.buffer.putUint8List(self); + } + + @protected + void sse_encode_my_downloader_status( + MyDownloaderStatus self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + switch (self) { + case MyDownloaderStatus_NoStart(): + sse_encode_i_32(0, serializer); + case MyDownloaderStatus_Running(): + sse_encode_i_32(1, serializer); + case MyDownloaderStatus_Pending(field0: final field0): + sse_encode_i_32(2, serializer); + sse_encode_my_network_item_pending_type(field0, serializer); + case MyDownloaderStatus_Error(field0: final field0): + sse_encode_i_32(3, serializer); + sse_encode_String(field0, serializer); + case MyDownloaderStatus_Finished(): + sse_encode_i_32(4, serializer); + } + } + + @protected + void sse_encode_my_network_item_pending_type( + MyNetworkItemPendingType self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_i_32(self.index, serializer); + } + + @protected + void sse_encode_u_64(int self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + serializer.buffer.putUint64(self); + } + + @protected + void sse_encode_u_8(int self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + serializer.buffer.putUint8(self); + } + + @protected + void sse_encode_unit(void self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + } + + @protected + void sse_encode_bool(bool self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + serializer.buffer.putUint8(self ? 1 : 0); + } +} diff --git a/lib/common/rust/frb_generated.io.dart b/lib/common/rust/frb_generated.io.dart new file mode 100644 index 0000000..6b9a97c --- /dev/null +++ b/lib/common/rust/frb_generated.io.dart @@ -0,0 +1,130 @@ +// This file is automatically generated, so please do not edit it. +// Generated by `flutter_rust_bridge`@ 2.0.0-dev.23. + +// ignore_for_file: unused_import, unused_element, unnecessary_import, duplicate_ignore, invalid_use_of_internal_member, annotate_overrides, non_constant_identifier_names, curly_braces_in_flow_control_structures, prefer_const_literals_to_create_immutables, unused_field + +import 'api/downloader_api.dart'; +import 'dart:async'; +import 'dart:convert'; +import 'dart:ffi' as ffi; +import 'downloader.dart'; +import 'frb_generated.dart'; +import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated_io.dart'; + +abstract class RustLibApiImplPlatform extends BaseApiImpl { + RustLibApiImplPlatform({ + required super.handler, + required super.wire, + required super.generalizedFrbRustBinding, + required super.portManager, + }); + + @protected + String dco_decode_String(dynamic raw); + + @protected + DownloadCallbackData dco_decode_download_callback_data(dynamic raw); + + @protected + int dco_decode_i_32(dynamic raw); + + @protected + Uint8List dco_decode_list_prim_u_8_strict(dynamic raw); + + @protected + MyDownloaderStatus dco_decode_my_downloader_status(dynamic raw); + + @protected + MyNetworkItemPendingType dco_decode_my_network_item_pending_type(dynamic raw); + + @protected + int dco_decode_u_64(dynamic raw); + + @protected + int dco_decode_u_8(dynamic raw); + + @protected + void dco_decode_unit(dynamic raw); + + @protected + String sse_decode_String(SseDeserializer deserializer); + + @protected + DownloadCallbackData sse_decode_download_callback_data( + SseDeserializer deserializer); + + @protected + int sse_decode_i_32(SseDeserializer deserializer); + + @protected + Uint8List sse_decode_list_prim_u_8_strict(SseDeserializer deserializer); + + @protected + MyDownloaderStatus sse_decode_my_downloader_status( + SseDeserializer deserializer); + + @protected + MyNetworkItemPendingType sse_decode_my_network_item_pending_type( + SseDeserializer deserializer); + + @protected + int sse_decode_u_64(SseDeserializer deserializer); + + @protected + int sse_decode_u_8(SseDeserializer deserializer); + + @protected + void sse_decode_unit(SseDeserializer deserializer); + + @protected + bool sse_decode_bool(SseDeserializer deserializer); + + @protected + void sse_encode_String(String self, SseSerializer serializer); + + @protected + void sse_encode_download_callback_data( + DownloadCallbackData self, SseSerializer serializer); + + @protected + void sse_encode_i_32(int self, SseSerializer serializer); + + @protected + void sse_encode_list_prim_u_8_strict( + Uint8List self, SseSerializer serializer); + + @protected + void sse_encode_my_downloader_status( + MyDownloaderStatus self, SseSerializer serializer); + + @protected + void sse_encode_my_network_item_pending_type( + MyNetworkItemPendingType self, SseSerializer serializer); + + @protected + void sse_encode_u_64(int self, SseSerializer serializer); + + @protected + void sse_encode_u_8(int self, SseSerializer serializer); + + @protected + void sse_encode_unit(void self, SseSerializer serializer); + + @protected + void sse_encode_bool(bool self, SseSerializer serializer); +} + +// Section: wire_class + +class RustLibWire implements BaseWire { + factory RustLibWire.fromExternalLibrary(ExternalLibrary lib) => + RustLibWire(lib.ffiDynamicLibrary); + + /// Holds the symbol lookup function. + final ffi.Pointer Function(String symbolName) + _lookup; + + /// The symbols are looked up in [dynamicLibrary]. + RustLibWire(ffi.DynamicLibrary dynamicLibrary) + : _lookup = dynamicLibrary.lookup; +} diff --git a/lib/common/rust/frb_generated.web.dart b/lib/common/rust/frb_generated.web.dart new file mode 100644 index 0000000..04cc46e --- /dev/null +++ b/lib/common/rust/frb_generated.web.dart @@ -0,0 +1,133 @@ +// This file is automatically generated, so please do not edit it. +// Generated by `flutter_rust_bridge`@ 2.0.0-dev.23. + +// ignore_for_file: unused_import, unused_element, unnecessary_import, duplicate_ignore, invalid_use_of_internal_member, annotate_overrides, non_constant_identifier_names, curly_braces_in_flow_control_structures, prefer_const_literals_to_create_immutables, unused_field + +import 'api/downloader_api.dart'; +import 'dart:async'; +import 'dart:convert'; +import 'downloader.dart'; +import 'frb_generated.dart'; +import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated_web.dart'; + +abstract class RustLibApiImplPlatform extends BaseApiImpl { + RustLibApiImplPlatform({ + required super.handler, + required super.wire, + required super.generalizedFrbRustBinding, + required super.portManager, + }); + + @protected + String dco_decode_String(dynamic raw); + + @protected + DownloadCallbackData dco_decode_download_callback_data(dynamic raw); + + @protected + int dco_decode_i_32(dynamic raw); + + @protected + Uint8List dco_decode_list_prim_u_8_strict(dynamic raw); + + @protected + MyDownloaderStatus dco_decode_my_downloader_status(dynamic raw); + + @protected + MyNetworkItemPendingType dco_decode_my_network_item_pending_type(dynamic raw); + + @protected + int dco_decode_u_64(dynamic raw); + + @protected + int dco_decode_u_8(dynamic raw); + + @protected + void dco_decode_unit(dynamic raw); + + @protected + String sse_decode_String(SseDeserializer deserializer); + + @protected + DownloadCallbackData sse_decode_download_callback_data( + SseDeserializer deserializer); + + @protected + int sse_decode_i_32(SseDeserializer deserializer); + + @protected + Uint8List sse_decode_list_prim_u_8_strict(SseDeserializer deserializer); + + @protected + MyDownloaderStatus sse_decode_my_downloader_status( + SseDeserializer deserializer); + + @protected + MyNetworkItemPendingType sse_decode_my_network_item_pending_type( + SseDeserializer deserializer); + + @protected + int sse_decode_u_64(SseDeserializer deserializer); + + @protected + int sse_decode_u_8(SseDeserializer deserializer); + + @protected + void sse_decode_unit(SseDeserializer deserializer); + + @protected + bool sse_decode_bool(SseDeserializer deserializer); + + @protected + void sse_encode_String(String self, SseSerializer serializer); + + @protected + void sse_encode_download_callback_data( + DownloadCallbackData self, SseSerializer serializer); + + @protected + void sse_encode_i_32(int self, SseSerializer serializer); + + @protected + void sse_encode_list_prim_u_8_strict( + Uint8List self, SseSerializer serializer); + + @protected + void sse_encode_my_downloader_status( + MyDownloaderStatus self, SseSerializer serializer); + + @protected + void sse_encode_my_network_item_pending_type( + MyNetworkItemPendingType self, SseSerializer serializer); + + @protected + void sse_encode_u_64(int self, SseSerializer serializer); + + @protected + void sse_encode_u_8(int self, SseSerializer serializer); + + @protected + void sse_encode_unit(void self, SseSerializer serializer); + + @protected + void sse_encode_bool(bool self, SseSerializer serializer); +} + +// Section: wire_class + +class RustLibWire implements BaseWire { + RustLibWire.fromExternalLibrary(ExternalLibrary lib); +} + +@JS('wasm_bindgen') +external RustLibWasmModule get wasmModule; + +@JS() +@anonymous +class RustLibWasmModule implements WasmModule { + @override + external Object /* Promise */ call([String? moduleName]); + + @override + external RustLibWasmModule bind(dynamic thisArg, String moduleName); +} diff --git a/lib/common/utils/base_utils.dart b/lib/common/utils/base_utils.dart index c5cde77..cb97c1e 100644 --- a/lib/common/utils/base_utils.dart +++ b/lib/common/utils/base_utils.dart @@ -106,10 +106,11 @@ Future showBaseDialog(BuildContext context, builder: (context) => ContentDialog( title: Text(title), content: content, - constraints: constraints ?? const BoxConstraints( - maxWidth: 512, - maxHeight: 756.0, - ), + constraints: constraints ?? + const BoxConstraints( + maxWidth: 512, + maxHeight: 756.0, + ), actions: actions, ), ); diff --git a/lib/common/utils/input_utils.dart b/lib/common/utils/input_utils.dart index e69de29..8b13789 100644 --- a/lib/common/utils/input_utils.dart +++ b/lib/common/utils/input_utils.dart @@ -0,0 +1 @@ + diff --git a/lib/data/app_placard_data.dart b/lib/data/app_placard_data.dart index c1dc2b2..922974f 100644 --- a/lib/data/app_placard_data.dart +++ b/lib/data/app_placard_data.dart @@ -8,13 +8,14 @@ class AppPlacardData { AppPlacardData({ - this.version, - this.title, - this.content, - this.link, - this.linkType, - this.alwaysShow, - this.enable,}); + this.version, + this.title, + this.content, + this.link, + this.linkType, + this.alwaysShow, + this.enable, + }); AppPlacardData.fromJson(dynamic json) { version = json['version']; @@ -44,5 +45,4 @@ class AppPlacardData { map['enable'] = enable; return map; } - -} \ No newline at end of file +} diff --git a/lib/data/app_web_localization_versions_data.dart b/lib/data/app_web_localization_versions_data.dart index 655495a..ce5f4ae 100644 --- a/lib/data/app_web_localization_versions_data.dart +++ b/lib/data/app_web_localization_versions_data.dart @@ -8,13 +8,14 @@ class AppWebLocalizationVersionsData { AppWebLocalizationVersionsData({ - this.rsi, - this.uex, - this.addresses, - this.concierge, - this.hangar, - this.orgs, - this.dps,}); + this.rsi, + this.uex, + this.addresses, + this.concierge, + this.hangar, + this.orgs, + this.dps, + }); AppWebLocalizationVersionsData.fromJson(dynamic json) { rsi = json['rsi']; @@ -44,5 +45,4 @@ class AppWebLocalizationVersionsData { map['dps'] = dps; return map; } - -} \ No newline at end of file +} diff --git a/lib/data/countdown_festival_item_data.dart b/lib/data/countdown_festival_item_data.dart index 91f2c0a..4da4c1d 100644 --- a/lib/data/countdown_festival_item_data.dart +++ b/lib/data/countdown_festival_item_data.dart @@ -1,8 +1,9 @@ class CountdownFestivalItemData { CountdownFestivalItemData({ - this.name, - this.time, - this.icon,}); + this.name, + this.time, + this.icon, + }); CountdownFestivalItemData.fromJson(dynamic json) { name = json['name']; @@ -20,5 +21,4 @@ class CountdownFestivalItemData { map['icon'] = icon; return map; } - -} \ No newline at end of file +} diff --git a/lib/data/game_performance_data.dart b/lib/data/game_performance_data.dart index f700a62..5894280 100644 --- a/lib/data/game_performance_data.dart +++ b/lib/data/game_performance_data.dart @@ -9,14 +9,15 @@ class GamePerformanceData { GamePerformanceData({ - this.key, - this.name, - this.info, - this.type, - this.max, - this.min, - this.value, - this.group,}); + this.key, + this.name, + this.info, + this.type, + this.max, + this.min, + this.value, + this.group, + }); GamePerformanceData.fromJson(dynamic json) { key = json['key']; @@ -49,5 +50,4 @@ class GamePerformanceData { map['group'] = group; return map; } - -} \ No newline at end of file +} diff --git a/lib/data/sc_localization_data.dart b/lib/data/sc_localization_data.dart index 4bb77fb..1ac6c50 100644 --- a/lib/data/sc_localization_data.dart +++ b/lib/data/sc_localization_data.dart @@ -7,12 +7,13 @@ class ScLocalizationData { ScLocalizationData({ - this.enable, - this.versionName, - this.updateAt, - this.info, - this.gameChannel, - this.note,}); + this.enable, + this.versionName, + this.updateAt, + this.info, + this.gameChannel, + this.note, + }); ScLocalizationData.fromJson(dynamic json) { enable = json['enable']; @@ -39,5 +40,4 @@ class ScLocalizationData { map['note'] = note; return map; } - -} \ No newline at end of file +} diff --git a/lib/generated/grpc/party_room_server/chat.pb.dart b/lib/generated/grpc/party_room_server/chat.pb.dart index 18bfa18..47dffaf 100644 --- a/lib/generated/grpc/party_room_server/chat.pb.dart +++ b/lib/generated/grpc/party_room_server/chat.pb.dart @@ -44,28 +44,43 @@ class ChatMessage extends $pb.GeneratedMessage { return $result; } ChatMessage._() : super(); - factory ChatMessage.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory ChatMessage.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + factory ChatMessage.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory ChatMessage.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'ChatMessage', createEmptyInstance: create) + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'ChatMessage', + createEmptyInstance: create) ..aOS(1, _omitFieldNames ? '' : 'senderID', protoName: 'senderID') ..aOS(2, _omitFieldNames ? '' : 'receiverID', protoName: 'receiverID') - ..e(3, _omitFieldNames ? '' : 'receiverType', $pb.PbFieldType.OE, protoName: 'receiverType', defaultOrMaker: ReceiverType.RoomMsg, valueOf: ReceiverType.valueOf, enumValues: ReceiverType.values) - ..e(4, _omitFieldNames ? '' : 'messageType', $pb.PbFieldType.OE, protoName: 'messageType', defaultOrMaker: MessageType.System, valueOf: MessageType.valueOf, enumValues: MessageType.values) + ..e( + 3, _omitFieldNames ? '' : 'receiverType', $pb.PbFieldType.OE, + protoName: 'receiverType', + defaultOrMaker: ReceiverType.RoomMsg, + valueOf: ReceiverType.valueOf, + enumValues: ReceiverType.values) + ..e( + 4, _omitFieldNames ? '' : 'messageType', $pb.PbFieldType.OE, + protoName: 'messageType', + defaultOrMaker: MessageType.System, + valueOf: MessageType.valueOf, + enumValues: MessageType.values) ..aOS(5, _omitFieldNames ? '' : 'data') - ..hasRequiredFields = false - ; + ..hasRequiredFields = false; - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') ChatMessage clone() => ChatMessage()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - ChatMessage copyWith(void Function(ChatMessage) updates) => super.copyWith((message) => updates(message as ChatMessage)) as ChatMessage; + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + ChatMessage copyWith(void Function(ChatMessage) updates) => + super.copyWith((message) => updates(message as ChatMessage)) + as ChatMessage; $pb.BuilderInfo get info_ => _i; @@ -74,13 +89,17 @@ class ChatMessage extends $pb.GeneratedMessage { ChatMessage createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') - static ChatMessage getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static ChatMessage getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); static ChatMessage? _defaultInstance; @$pb.TagNumber(1) $core.String get senderID => $_getSZ(0); @$pb.TagNumber(1) - set senderID($core.String v) { $_setString(0, v); } + set senderID($core.String v) { + $_setString(0, v); + } + @$pb.TagNumber(1) $core.bool hasSenderID() => $_has(0); @$pb.TagNumber(1) @@ -89,7 +108,10 @@ class ChatMessage extends $pb.GeneratedMessage { @$pb.TagNumber(2) $core.String get receiverID => $_getSZ(1); @$pb.TagNumber(2) - set receiverID($core.String v) { $_setString(1, v); } + set receiverID($core.String v) { + $_setString(1, v); + } + @$pb.TagNumber(2) $core.bool hasReceiverID() => $_has(1); @$pb.TagNumber(2) @@ -98,7 +120,10 @@ class ChatMessage extends $pb.GeneratedMessage { @$pb.TagNumber(3) ReceiverType get receiverType => $_getN(2); @$pb.TagNumber(3) - set receiverType(ReceiverType v) { setField(3, v); } + set receiverType(ReceiverType v) { + setField(3, v); + } + @$pb.TagNumber(3) $core.bool hasReceiverType() => $_has(2); @$pb.TagNumber(3) @@ -107,7 +132,10 @@ class ChatMessage extends $pb.GeneratedMessage { @$pb.TagNumber(4) MessageType get messageType => $_getN(3); @$pb.TagNumber(4) - set messageType(MessageType v) { setField(4, v); } + set messageType(MessageType v) { + setField(4, v); + } + @$pb.TagNumber(4) $core.bool hasMessageType() => $_has(3); @$pb.TagNumber(4) @@ -116,13 +144,16 @@ class ChatMessage extends $pb.GeneratedMessage { @$pb.TagNumber(5) $core.String get data => $_getSZ(4); @$pb.TagNumber(5) - set data($core.String v) { $_setString(4, v); } + set data($core.String v) { + $_setString(4, v); + } + @$pb.TagNumber(5) $core.bool hasData() => $_has(4); @$pb.TagNumber(5) void clearData() => clearField(5); } - const _omitFieldNames = $core.bool.fromEnvironment('protobuf.omit_field_names'); -const _omitMessageNames = $core.bool.fromEnvironment('protobuf.omit_message_names'); +const _omitMessageNames = + $core.bool.fromEnvironment('protobuf.omit_message_names'); diff --git a/lib/generated/grpc/party_room_server/chat.pbenum.dart b/lib/generated/grpc/party_room_server/chat.pbenum.dart index 181917c..405cda8 100644 --- a/lib/generated/grpc/party_room_server/chat.pbenum.dart +++ b/lib/generated/grpc/party_room_server/chat.pbenum.dart @@ -14,38 +14,45 @@ import 'dart:core' as $core; import 'package:protobuf/protobuf.dart' as $pb; class ReceiverType extends $pb.ProtobufEnum { - static const ReceiverType RoomMsg = ReceiverType._(0, _omitEnumNames ? '' : 'RoomMsg'); - static const ReceiverType PrivateMsg = ReceiverType._(1, _omitEnumNames ? '' : 'PrivateMsg'); + static const ReceiverType RoomMsg = + ReceiverType._(0, _omitEnumNames ? '' : 'RoomMsg'); + static const ReceiverType PrivateMsg = + ReceiverType._(1, _omitEnumNames ? '' : 'PrivateMsg'); - static const $core.List values = [ + static const $core.List values = [ RoomMsg, PrivateMsg, ]; - static final $core.Map<$core.int, ReceiverType> _byValue = $pb.ProtobufEnum.initByValue(values); + static final $core.Map<$core.int, ReceiverType> _byValue = + $pb.ProtobufEnum.initByValue(values); static ReceiverType? valueOf($core.int value) => _byValue[value]; const ReceiverType._($core.int v, $core.String n) : super(v, n); } class MessageType extends $pb.ProtobufEnum { - static const MessageType System = MessageType._(0, _omitEnumNames ? '' : 'System'); - static const MessageType Text = MessageType._(1, _omitEnumNames ? '' : 'Text'); - static const MessageType Image = MessageType._(2, _omitEnumNames ? '' : 'Image'); - static const MessageType Markdown = MessageType._(3, _omitEnumNames ? '' : 'Markdown'); + static const MessageType System = + MessageType._(0, _omitEnumNames ? '' : 'System'); + static const MessageType Text = + MessageType._(1, _omitEnumNames ? '' : 'Text'); + static const MessageType Image = + MessageType._(2, _omitEnumNames ? '' : 'Image'); + static const MessageType Markdown = + MessageType._(3, _omitEnumNames ? '' : 'Markdown'); - static const $core.List values = [ + static const $core.List values = [ System, Text, Image, Markdown, ]; - static final $core.Map<$core.int, MessageType> _byValue = $pb.ProtobufEnum.initByValue(values); + static final $core.Map<$core.int, MessageType> _byValue = + $pb.ProtobufEnum.initByValue(values); static MessageType? valueOf($core.int value) => _byValue[value]; const MessageType._($core.int v, $core.String n) : super(v, n); } - const _omitEnumNames = $core.bool.fromEnvironment('protobuf.omit_enum_names'); diff --git a/lib/generated/grpc/party_room_server/chat.pbgrpc.dart b/lib/generated/grpc/party_room_server/chat.pbgrpc.dart index e3c9cce..a5c0122 100644 --- a/lib/generated/grpc/party_room_server/chat.pbgrpc.dart +++ b/lib/generated/grpc/party_room_server/chat.pbgrpc.dart @@ -26,22 +26,26 @@ class ChatServiceClient extends $grpc.Client { '/ChatService/ListenMessage', ($0.PreUser value) => value.writeToBuffer(), ($core.List<$core.int> value) => $1.ChatMessage.fromBuffer(value)); - static final _$sendMessage = $grpc.ClientMethod<$1.ChatMessage, $0.BaseRespData>( - '/ChatService/SendMessage', - ($1.ChatMessage value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.BaseRespData.fromBuffer(value)); + static final _$sendMessage = + $grpc.ClientMethod<$1.ChatMessage, $0.BaseRespData>( + '/ChatService/SendMessage', + ($1.ChatMessage value) => value.writeToBuffer(), + ($core.List<$core.int> value) => $0.BaseRespData.fromBuffer(value)); ChatServiceClient($grpc.ClientChannel channel, {$grpc.CallOptions? options, $core.Iterable<$grpc.ClientInterceptor>? interceptors}) - : super(channel, options: options, - interceptors: interceptors); + : super(channel, options: options, interceptors: interceptors); - $grpc.ResponseStream<$1.ChatMessage> listenMessage($0.PreUser request, {$grpc.CallOptions? options}) { - return $createStreamingCall(_$listenMessage, $async.Stream.fromIterable([request]), options: options); + $grpc.ResponseStream<$1.ChatMessage> listenMessage($0.PreUser request, + {$grpc.CallOptions? options}) { + return $createStreamingCall( + _$listenMessage, $async.Stream.fromIterable([request]), + options: options); } - $grpc.ResponseFuture<$0.BaseRespData> sendMessage($1.ChatMessage request, {$grpc.CallOptions? options}) { + $grpc.ResponseFuture<$0.BaseRespData> sendMessage($1.ChatMessage request, + {$grpc.CallOptions? options}) { return $createUnaryCall(_$sendMessage, request, options: options); } } @@ -67,14 +71,18 @@ abstract class ChatServiceBase extends $grpc.Service { ($0.BaseRespData value) => value.writeToBuffer())); } - $async.Stream<$1.ChatMessage> listenMessage_Pre($grpc.ServiceCall call, $async.Future<$0.PreUser> request) async* { + $async.Stream<$1.ChatMessage> listenMessage_Pre( + $grpc.ServiceCall call, $async.Future<$0.PreUser> request) async* { yield* listenMessage(call, await request); } - $async.Future<$0.BaseRespData> sendMessage_Pre($grpc.ServiceCall call, $async.Future<$1.ChatMessage> request) async { + $async.Future<$0.BaseRespData> sendMessage_Pre( + $grpc.ServiceCall call, $async.Future<$1.ChatMessage> request) async { return sendMessage(call, await request); } - $async.Stream<$1.ChatMessage> listenMessage($grpc.ServiceCall call, $0.PreUser request); - $async.Future<$0.BaseRespData> sendMessage($grpc.ServiceCall call, $1.ChatMessage request); + $async.Stream<$1.ChatMessage> listenMessage( + $grpc.ServiceCall call, $0.PreUser request); + $async.Future<$0.BaseRespData> sendMessage( + $grpc.ServiceCall call, $1.ChatMessage request); } diff --git a/lib/generated/grpc/party_room_server/chat.pbjson.dart b/lib/generated/grpc/party_room_server/chat.pbjson.dart index cd79d50..f05b0ac 100644 --- a/lib/generated/grpc/party_room_server/chat.pbjson.dart +++ b/lib/generated/grpc/party_room_server/chat.pbjson.dart @@ -48,8 +48,22 @@ const ChatMessage$json = { '2': [ {'1': 'senderID', '3': 1, '4': 1, '5': 9, '10': 'senderID'}, {'1': 'receiverID', '3': 2, '4': 1, '5': 9, '10': 'receiverID'}, - {'1': 'receiverType', '3': 3, '4': 1, '5': 14, '6': '.ReceiverType', '10': 'receiverType'}, - {'1': 'messageType', '3': 4, '4': 1, '5': 14, '6': '.MessageType', '10': 'messageType'}, + { + '1': 'receiverType', + '3': 3, + '4': 1, + '5': 14, + '6': '.ReceiverType', + '10': 'receiverType' + }, + { + '1': 'messageType', + '3': 4, + '4': 1, + '5': 14, + '6': '.MessageType', + '10': 'messageType' + }, {'1': 'data', '3': 5, '4': 1, '5': 9, '10': 'data'}, ], }; @@ -60,4 +74,3 @@ final $typed_data.Uint8List chatMessageDescriptor = $convert.base64Decode( 'gCIAEoCVIKcmVjZWl2ZXJJRBIxCgxyZWNlaXZlclR5cGUYAyABKA4yDS5SZWNlaXZlclR5cGVS' 'DHJlY2VpdmVyVHlwZRIuCgttZXNzYWdlVHlwZRgEIAEoDjIMLk1lc3NhZ2VUeXBlUgttZXNzYW' 'dlVHlwZRISCgRkYXRhGAUgASgJUgRkYXRh'); - diff --git a/lib/generated/grpc/party_room_server/index.pb.dart b/lib/generated/grpc/party_room_server/index.pb.dart index c8d6525..38d4ad6 100644 --- a/lib/generated/grpc/party_room_server/index.pb.dart +++ b/lib/generated/grpc/party_room_server/index.pb.dart @@ -21,23 +21,27 @@ export 'index.pbenum.dart'; class Empty extends $pb.GeneratedMessage { factory Empty() => create(); Empty._() : super(); - factory Empty.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory Empty.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + factory Empty.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory Empty.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'Empty', createEmptyInstance: create) - ..hasRequiredFields = false - ; + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'Empty', + createEmptyInstance: create) + ..hasRequiredFields = false; - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') Empty clone() => Empty()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - Empty copyWith(void Function(Empty) updates) => super.copyWith((message) => updates(message as Empty)) as Empty; + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + Empty copyWith(void Function(Empty) updates) => + super.copyWith((message) => updates(message as Empty)) as Empty; $pb.BuilderInfo get info_ => _i; @@ -46,7 +50,8 @@ class Empty extends $pb.GeneratedMessage { Empty createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') - static Empty getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static Empty getDefault() => + _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static Empty? _defaultInstance; } @@ -65,40 +70,50 @@ class BaseRespData extends $pb.GeneratedMessage { return $result; } BaseRespData._() : super(); - factory BaseRespData.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory BaseRespData.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + factory BaseRespData.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory BaseRespData.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'BaseRespData', createEmptyInstance: create) + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'BaseRespData', + createEmptyInstance: create) ..a<$core.int>(1, _omitFieldNames ? '' : 'code', $pb.PbFieldType.O3) ..aOS(2, _omitFieldNames ? '' : 'message') - ..hasRequiredFields = false - ; + ..hasRequiredFields = false; - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') BaseRespData clone() => BaseRespData()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - BaseRespData copyWith(void Function(BaseRespData) updates) => super.copyWith((message) => updates(message as BaseRespData)) as BaseRespData; + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + BaseRespData copyWith(void Function(BaseRespData) updates) => + super.copyWith((message) => updates(message as BaseRespData)) + as BaseRespData; $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static BaseRespData create() => BaseRespData._(); BaseRespData createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); + static $pb.PbList createRepeated() => + $pb.PbList(); @$core.pragma('dart2js:noInline') - static BaseRespData getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static BaseRespData getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); static BaseRespData? _defaultInstance; @$pb.TagNumber(1) $core.int get code => $_getIZ(0); @$pb.TagNumber(1) - set code($core.int v) { $_setSignedInt32(0, v); } + set code($core.int v) { + $_setSignedInt32(0, v); + } + @$pb.TagNumber(1) $core.bool hasCode() => $_has(0); @$pb.TagNumber(1) @@ -107,7 +122,10 @@ class BaseRespData extends $pb.GeneratedMessage { @$pb.TagNumber(2) $core.String get message => $_getSZ(1); @$pb.TagNumber(2) - set message($core.String v) { $_setString(1, v); } + set message($core.String v) { + $_setString(1, v); + } + @$pb.TagNumber(2) $core.bool hasMessage() => $_has(1); @$pb.TagNumber(2) @@ -141,43 +159,55 @@ class BasePageRespData extends $pb.GeneratedMessage { return $result; } BasePageRespData._() : super(); - factory BasePageRespData.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory BasePageRespData.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + factory BasePageRespData.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory BasePageRespData.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'BasePageRespData', createEmptyInstance: create) + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'BasePageRespData', + createEmptyInstance: create) ..a<$core.int>(1, _omitFieldNames ? '' : 'code', $pb.PbFieldType.O3) ..aOS(2, _omitFieldNames ? '' : 'message') ..aOB(3, _omitFieldNames ? '' : 'hasNext', protoName: 'hasNext') - ..a<$fixnum.Int64>(4, _omitFieldNames ? '' : 'curPageNum', $pb.PbFieldType.OU6, protoName: 'curPageNum', defaultOrMaker: $fixnum.Int64.ZERO) + ..a<$fixnum.Int64>( + 4, _omitFieldNames ? '' : 'curPageNum', $pb.PbFieldType.OU6, + protoName: 'curPageNum', defaultOrMaker: $fixnum.Int64.ZERO) ..aInt64(5, _omitFieldNames ? '' : 'pageSize', protoName: 'pageSize') - ..hasRequiredFields = false - ; + ..hasRequiredFields = false; - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') BasePageRespData clone() => BasePageRespData()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - BasePageRespData copyWith(void Function(BasePageRespData) updates) => super.copyWith((message) => updates(message as BasePageRespData)) as BasePageRespData; + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + BasePageRespData copyWith(void Function(BasePageRespData) updates) => + super.copyWith((message) => updates(message as BasePageRespData)) + as BasePageRespData; $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static BasePageRespData create() => BasePageRespData._(); BasePageRespData createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); + static $pb.PbList createRepeated() => + $pb.PbList(); @$core.pragma('dart2js:noInline') - static BasePageRespData getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static BasePageRespData getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); static BasePageRespData? _defaultInstance; @$pb.TagNumber(1) $core.int get code => $_getIZ(0); @$pb.TagNumber(1) - set code($core.int v) { $_setSignedInt32(0, v); } + set code($core.int v) { + $_setSignedInt32(0, v); + } + @$pb.TagNumber(1) $core.bool hasCode() => $_has(0); @$pb.TagNumber(1) @@ -186,7 +216,10 @@ class BasePageRespData extends $pb.GeneratedMessage { @$pb.TagNumber(2) $core.String get message => $_getSZ(1); @$pb.TagNumber(2) - set message($core.String v) { $_setString(1, v); } + set message($core.String v) { + $_setString(1, v); + } + @$pb.TagNumber(2) $core.bool hasMessage() => $_has(1); @$pb.TagNumber(2) @@ -195,7 +228,10 @@ class BasePageRespData extends $pb.GeneratedMessage { @$pb.TagNumber(3) $core.bool get hasNext => $_getBF(2); @$pb.TagNumber(3) - set hasNext($core.bool v) { $_setBool(2, v); } + set hasNext($core.bool v) { + $_setBool(2, v); + } + @$pb.TagNumber(3) $core.bool hasHasNext() => $_has(2); @$pb.TagNumber(3) @@ -204,7 +240,10 @@ class BasePageRespData extends $pb.GeneratedMessage { @$pb.TagNumber(4) $fixnum.Int64 get curPageNum => $_getI64(3); @$pb.TagNumber(4) - set curPageNum($fixnum.Int64 v) { $_setInt64(3, v); } + set curPageNum($fixnum.Int64 v) { + $_setInt64(3, v); + } + @$pb.TagNumber(4) $core.bool hasCurPageNum() => $_has(3); @$pb.TagNumber(4) @@ -213,7 +252,10 @@ class BasePageRespData extends $pb.GeneratedMessage { @$pb.TagNumber(5) $fixnum.Int64 get pageSize => $_getI64(4); @$pb.TagNumber(5) - set pageSize($fixnum.Int64 v) { $_setInt64(4, v); } + set pageSize($fixnum.Int64 v) { + $_setInt64(4, v); + } + @$pb.TagNumber(5) $core.bool hasPageSize() => $_has(4); @$pb.TagNumber(5) @@ -239,26 +281,34 @@ class PingData extends $pb.GeneratedMessage { return $result; } PingData._() : super(); - factory PingData.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory PingData.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + factory PingData.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory PingData.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'PingData', createEmptyInstance: create) + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'PingData', + createEmptyInstance: create) ..aOS(1, _omitFieldNames ? '' : 'data') - ..a<$fixnum.Int64>(2, _omitFieldNames ? '' : 'clientVersion', $pb.PbFieldType.OS6, protoName: 'clientVersion', defaultOrMaker: $fixnum.Int64.ZERO) - ..a<$fixnum.Int64>(3, _omitFieldNames ? '' : 'serverVersion', $pb.PbFieldType.OS6, protoName: 'serverVersion', defaultOrMaker: $fixnum.Int64.ZERO) - ..hasRequiredFields = false - ; + ..a<$fixnum.Int64>( + 2, _omitFieldNames ? '' : 'clientVersion', $pb.PbFieldType.OS6, + protoName: 'clientVersion', defaultOrMaker: $fixnum.Int64.ZERO) + ..a<$fixnum.Int64>( + 3, _omitFieldNames ? '' : 'serverVersion', $pb.PbFieldType.OS6, + protoName: 'serverVersion', defaultOrMaker: $fixnum.Int64.ZERO) + ..hasRequiredFields = false; - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') PingData clone() => PingData()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - PingData copyWith(void Function(PingData) updates) => super.copyWith((message) => updates(message as PingData)) as PingData; + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + PingData copyWith(void Function(PingData) updates) => + super.copyWith((message) => updates(message as PingData)) as PingData; $pb.BuilderInfo get info_ => _i; @@ -267,13 +317,17 @@ class PingData extends $pb.GeneratedMessage { PingData createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') - static PingData getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static PingData getDefault() => + _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static PingData? _defaultInstance; @$pb.TagNumber(1) $core.String get data => $_getSZ(0); @$pb.TagNumber(1) - set data($core.String v) { $_setString(0, v); } + set data($core.String v) { + $_setString(0, v); + } + @$pb.TagNumber(1) $core.bool hasData() => $_has(0); @$pb.TagNumber(1) @@ -282,7 +336,10 @@ class PingData extends $pb.GeneratedMessage { @$pb.TagNumber(2) $fixnum.Int64 get clientVersion => $_getI64(1); @$pb.TagNumber(2) - set clientVersion($fixnum.Int64 v) { $_setInt64(1, v); } + set clientVersion($fixnum.Int64 v) { + $_setInt64(1, v); + } + @$pb.TagNumber(2) $core.bool hasClientVersion() => $_has(1); @$pb.TagNumber(2) @@ -291,7 +348,10 @@ class PingData extends $pb.GeneratedMessage { @$pb.TagNumber(3) $fixnum.Int64 get serverVersion => $_getI64(2); @$pb.TagNumber(3) - set serverVersion($fixnum.Int64 v) { $_setInt64(2, v); } + set serverVersion($fixnum.Int64 v) { + $_setInt64(2, v); + } + @$pb.TagNumber(3) $core.bool hasServerVersion() => $_has(2); @$pb.TagNumber(3) @@ -309,33 +369,41 @@ class RoomTypesData extends $pb.GeneratedMessage { return $result; } RoomTypesData._() : super(); - factory RoomTypesData.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory RoomTypesData.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + factory RoomTypesData.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory RoomTypesData.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'RoomTypesData', createEmptyInstance: create) - ..pc(1, _omitFieldNames ? '' : 'roomTypes', $pb.PbFieldType.PM, protoName: 'roomTypes', subBuilder: RoomType.create) - ..hasRequiredFields = false - ; + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'RoomTypesData', + createEmptyInstance: create) + ..pc(1, _omitFieldNames ? '' : 'roomTypes', $pb.PbFieldType.PM, + protoName: 'roomTypes', subBuilder: RoomType.create) + ..hasRequiredFields = false; - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') RoomTypesData clone() => RoomTypesData()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - RoomTypesData copyWith(void Function(RoomTypesData) updates) => super.copyWith((message) => updates(message as RoomTypesData)) as RoomTypesData; + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + RoomTypesData copyWith(void Function(RoomTypesData) updates) => + super.copyWith((message) => updates(message as RoomTypesData)) + as RoomTypesData; $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static RoomTypesData create() => RoomTypesData._(); RoomTypesData createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); + static $pb.PbList createRepeated() => + $pb.PbList(); @$core.pragma('dart2js:noInline') - static RoomTypesData getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static RoomTypesData getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); static RoomTypesData? _defaultInstance; @$pb.TagNumber(1) @@ -369,28 +437,33 @@ class RoomType extends $pb.GeneratedMessage { return $result; } RoomType._() : super(); - factory RoomType.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory RoomType.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + factory RoomType.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory RoomType.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'RoomType', createEmptyInstance: create) + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'RoomType', + createEmptyInstance: create) ..aOS(1, _omitFieldNames ? '' : 'id') ..aOS(2, _omitFieldNames ? '' : 'name') ..aOS(3, _omitFieldNames ? '' : 'icon') ..aOS(4, _omitFieldNames ? '' : 'desc') - ..pc(5, _omitFieldNames ? '' : 'subTypes', $pb.PbFieldType.PM, protoName: 'subTypes', subBuilder: RoomSubtype.create) - ..hasRequiredFields = false - ; + ..pc(5, _omitFieldNames ? '' : 'subTypes', $pb.PbFieldType.PM, + protoName: 'subTypes', subBuilder: RoomSubtype.create) + ..hasRequiredFields = false; - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') RoomType clone() => RoomType()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - RoomType copyWith(void Function(RoomType) updates) => super.copyWith((message) => updates(message as RoomType)) as RoomType; + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + RoomType copyWith(void Function(RoomType) updates) => + super.copyWith((message) => updates(message as RoomType)) as RoomType; $pb.BuilderInfo get info_ => _i; @@ -399,13 +472,17 @@ class RoomType extends $pb.GeneratedMessage { RoomType createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') - static RoomType getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static RoomType getDefault() => + _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static RoomType? _defaultInstance; @$pb.TagNumber(1) $core.String get id => $_getSZ(0); @$pb.TagNumber(1) - set id($core.String v) { $_setString(0, v); } + set id($core.String v) { + $_setString(0, v); + } + @$pb.TagNumber(1) $core.bool hasId() => $_has(0); @$pb.TagNumber(1) @@ -414,7 +491,10 @@ class RoomType extends $pb.GeneratedMessage { @$pb.TagNumber(2) $core.String get name => $_getSZ(1); @$pb.TagNumber(2) - set name($core.String v) { $_setString(1, v); } + set name($core.String v) { + $_setString(1, v); + } + @$pb.TagNumber(2) $core.bool hasName() => $_has(1); @$pb.TagNumber(2) @@ -423,7 +503,10 @@ class RoomType extends $pb.GeneratedMessage { @$pb.TagNumber(3) $core.String get icon => $_getSZ(2); @$pb.TagNumber(3) - set icon($core.String v) { $_setString(2, v); } + set icon($core.String v) { + $_setString(2, v); + } + @$pb.TagNumber(3) $core.bool hasIcon() => $_has(2); @$pb.TagNumber(3) @@ -432,7 +515,10 @@ class RoomType extends $pb.GeneratedMessage { @$pb.TagNumber(4) $core.String get desc => $_getSZ(3); @$pb.TagNumber(4) - set desc($core.String v) { $_setString(3, v); } + set desc($core.String v) { + $_setString(3, v); + } + @$pb.TagNumber(4) $core.bool hasDesc() => $_has(3); @$pb.TagNumber(4) @@ -457,25 +543,30 @@ class RoomSubtype extends $pb.GeneratedMessage { return $result; } RoomSubtype._() : super(); - factory RoomSubtype.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory RoomSubtype.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + factory RoomSubtype.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory RoomSubtype.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'RoomSubtype', createEmptyInstance: create) + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'RoomSubtype', + createEmptyInstance: create) ..aOS(1, _omitFieldNames ? '' : 'id') ..aOS(2, _omitFieldNames ? '' : 'name') - ..hasRequiredFields = false - ; + ..hasRequiredFields = false; - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') RoomSubtype clone() => RoomSubtype()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - RoomSubtype copyWith(void Function(RoomSubtype) updates) => super.copyWith((message) => updates(message as RoomSubtype)) as RoomSubtype; + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + RoomSubtype copyWith(void Function(RoomSubtype) updates) => + super.copyWith((message) => updates(message as RoomSubtype)) + as RoomSubtype; $pb.BuilderInfo get info_ => _i; @@ -484,13 +575,17 @@ class RoomSubtype extends $pb.GeneratedMessage { RoomSubtype createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') - static RoomSubtype getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static RoomSubtype getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); static RoomSubtype? _defaultInstance; @$pb.TagNumber(1) $core.String get id => $_getSZ(0); @$pb.TagNumber(1) - set id($core.String v) { $_setString(0, v); } + set id($core.String v) { + $_setString(0, v); + } + @$pb.TagNumber(1) $core.bool hasId() => $_has(0); @$pb.TagNumber(1) @@ -499,7 +594,10 @@ class RoomSubtype extends $pb.GeneratedMessage { @$pb.TagNumber(2) $core.String get name => $_getSZ(1); @$pb.TagNumber(2) - set name($core.String v) { $_setString(1, v); } + set name($core.String v) { + $_setString(1, v); + } + @$pb.TagNumber(2) $core.bool hasName() => $_has(1); @$pb.TagNumber(2) @@ -561,35 +659,45 @@ class RoomData extends $pb.GeneratedMessage { return $result; } RoomData._() : super(); - factory RoomData.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory RoomData.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + factory RoomData.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory RoomData.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'RoomData', createEmptyInstance: create) + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'RoomData', + createEmptyInstance: create) ..aOS(1, _omitFieldNames ? '' : 'id') ..aOS(2, _omitFieldNames ? '' : 'roomTypeID', protoName: 'roomTypeID') - ..pPS(3, _omitFieldNames ? '' : 'roomSubTypeIds', protoName: 'roomSubTypeIds') + ..pPS(3, _omitFieldNames ? '' : 'roomSubTypeIds', + protoName: 'roomSubTypeIds') ..aOS(4, _omitFieldNames ? '' : 'owner') - ..a<$core.int>(5, _omitFieldNames ? '' : 'maxPlayer', $pb.PbFieldType.O3, protoName: 'maxPlayer') + ..a<$core.int>(5, _omitFieldNames ? '' : 'maxPlayer', $pb.PbFieldType.O3, + protoName: 'maxPlayer') ..aInt64(6, _omitFieldNames ? '' : 'createTime', protoName: 'createTime') - ..a<$core.int>(7, _omitFieldNames ? '' : 'curPlayer', $pb.PbFieldType.O3, protoName: 'curPlayer') - ..e(8, _omitFieldNames ? '' : 'status', $pb.PbFieldType.OE, defaultOrMaker: RoomStatus.All, valueOf: RoomStatus.valueOf, enumValues: RoomStatus.values) + ..a<$core.int>(7, _omitFieldNames ? '' : 'curPlayer', $pb.PbFieldType.O3, + protoName: 'curPlayer') + ..e(8, _omitFieldNames ? '' : 'status', $pb.PbFieldType.OE, + defaultOrMaker: RoomStatus.All, + valueOf: RoomStatus.valueOf, + enumValues: RoomStatus.values) ..aOS(9, _omitFieldNames ? '' : 'deviceUUID', protoName: 'deviceUUID') ..aOS(10, _omitFieldNames ? '' : 'announcement') ..aOS(11, _omitFieldNames ? '' : 'avatar') ..aInt64(12, _omitFieldNames ? '' : 'updateTime', protoName: 'updateTime') - ..hasRequiredFields = false - ; + ..hasRequiredFields = false; - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') RoomData clone() => RoomData()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - RoomData copyWith(void Function(RoomData) updates) => super.copyWith((message) => updates(message as RoomData)) as RoomData; + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + RoomData copyWith(void Function(RoomData) updates) => + super.copyWith((message) => updates(message as RoomData)) as RoomData; $pb.BuilderInfo get info_ => _i; @@ -598,13 +706,17 @@ class RoomData extends $pb.GeneratedMessage { RoomData createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') - static RoomData getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static RoomData getDefault() => + _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static RoomData? _defaultInstance; @$pb.TagNumber(1) $core.String get id => $_getSZ(0); @$pb.TagNumber(1) - set id($core.String v) { $_setString(0, v); } + set id($core.String v) { + $_setString(0, v); + } + @$pb.TagNumber(1) $core.bool hasId() => $_has(0); @$pb.TagNumber(1) @@ -613,7 +725,10 @@ class RoomData extends $pb.GeneratedMessage { @$pb.TagNumber(2) $core.String get roomTypeID => $_getSZ(1); @$pb.TagNumber(2) - set roomTypeID($core.String v) { $_setString(1, v); } + set roomTypeID($core.String v) { + $_setString(1, v); + } + @$pb.TagNumber(2) $core.bool hasRoomTypeID() => $_has(1); @$pb.TagNumber(2) @@ -625,7 +740,10 @@ class RoomData extends $pb.GeneratedMessage { @$pb.TagNumber(4) $core.String get owner => $_getSZ(3); @$pb.TagNumber(4) - set owner($core.String v) { $_setString(3, v); } + set owner($core.String v) { + $_setString(3, v); + } + @$pb.TagNumber(4) $core.bool hasOwner() => $_has(3); @$pb.TagNumber(4) @@ -634,7 +752,10 @@ class RoomData extends $pb.GeneratedMessage { @$pb.TagNumber(5) $core.int get maxPlayer => $_getIZ(4); @$pb.TagNumber(5) - set maxPlayer($core.int v) { $_setSignedInt32(4, v); } + set maxPlayer($core.int v) { + $_setSignedInt32(4, v); + } + @$pb.TagNumber(5) $core.bool hasMaxPlayer() => $_has(4); @$pb.TagNumber(5) @@ -643,7 +764,10 @@ class RoomData extends $pb.GeneratedMessage { @$pb.TagNumber(6) $fixnum.Int64 get createTime => $_getI64(5); @$pb.TagNumber(6) - set createTime($fixnum.Int64 v) { $_setInt64(5, v); } + set createTime($fixnum.Int64 v) { + $_setInt64(5, v); + } + @$pb.TagNumber(6) $core.bool hasCreateTime() => $_has(5); @$pb.TagNumber(6) @@ -652,7 +776,10 @@ class RoomData extends $pb.GeneratedMessage { @$pb.TagNumber(7) $core.int get curPlayer => $_getIZ(6); @$pb.TagNumber(7) - set curPlayer($core.int v) { $_setSignedInt32(6, v); } + set curPlayer($core.int v) { + $_setSignedInt32(6, v); + } + @$pb.TagNumber(7) $core.bool hasCurPlayer() => $_has(6); @$pb.TagNumber(7) @@ -661,7 +788,10 @@ class RoomData extends $pb.GeneratedMessage { @$pb.TagNumber(8) RoomStatus get status => $_getN(7); @$pb.TagNumber(8) - set status(RoomStatus v) { setField(8, v); } + set status(RoomStatus v) { + setField(8, v); + } + @$pb.TagNumber(8) $core.bool hasStatus() => $_has(7); @$pb.TagNumber(8) @@ -670,7 +800,10 @@ class RoomData extends $pb.GeneratedMessage { @$pb.TagNumber(9) $core.String get deviceUUID => $_getSZ(8); @$pb.TagNumber(9) - set deviceUUID($core.String v) { $_setString(8, v); } + set deviceUUID($core.String v) { + $_setString(8, v); + } + @$pb.TagNumber(9) $core.bool hasDeviceUUID() => $_has(8); @$pb.TagNumber(9) @@ -679,7 +812,10 @@ class RoomData extends $pb.GeneratedMessage { @$pb.TagNumber(10) $core.String get announcement => $_getSZ(9); @$pb.TagNumber(10) - set announcement($core.String v) { $_setString(9, v); } + set announcement($core.String v) { + $_setString(9, v); + } + @$pb.TagNumber(10) $core.bool hasAnnouncement() => $_has(9); @$pb.TagNumber(10) @@ -688,7 +824,10 @@ class RoomData extends $pb.GeneratedMessage { @$pb.TagNumber(11) $core.String get avatar => $_getSZ(10); @$pb.TagNumber(11) - set avatar($core.String v) { $_setString(10, v); } + set avatar($core.String v) { + $_setString(10, v); + } + @$pb.TagNumber(11) $core.bool hasAvatar() => $_has(10); @$pb.TagNumber(11) @@ -697,7 +836,10 @@ class RoomData extends $pb.GeneratedMessage { @$pb.TagNumber(12) $fixnum.Int64 get updateTime => $_getI64(11); @$pb.TagNumber(12) - set updateTime($fixnum.Int64 v) { $_setInt64(11, v); } + set updateTime($fixnum.Int64 v) { + $_setInt64(11, v); + } + @$pb.TagNumber(12) $core.bool hasUpdateTime() => $_has(11); @$pb.TagNumber(12) @@ -731,43 +873,60 @@ class RoomListPageReqData extends $pb.GeneratedMessage { return $result; } RoomListPageReqData._() : super(); - factory RoomListPageReqData.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory RoomListPageReqData.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + factory RoomListPageReqData.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory RoomListPageReqData.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'RoomListPageReqData', createEmptyInstance: create) + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'RoomListPageReqData', + createEmptyInstance: create) ..aOS(1, _omitFieldNames ? '' : 'typeID', protoName: 'typeID') ..aOS(2, _omitFieldNames ? '' : 'subTypeID', protoName: 'subTypeID') - ..e(3, _omitFieldNames ? '' : 'status', $pb.PbFieldType.OE, defaultOrMaker: RoomStatus.All, valueOf: RoomStatus.valueOf, enumValues: RoomStatus.values) - ..e(4, _omitFieldNames ? '' : 'sort', $pb.PbFieldType.OE, defaultOrMaker: RoomSortType.Default, valueOf: RoomSortType.valueOf, enumValues: RoomSortType.values) - ..a<$fixnum.Int64>(5, _omitFieldNames ? '' : 'pageNum', $pb.PbFieldType.OU6, protoName: 'pageNum', defaultOrMaker: $fixnum.Int64.ZERO) - ..hasRequiredFields = false - ; + ..e(3, _omitFieldNames ? '' : 'status', $pb.PbFieldType.OE, + defaultOrMaker: RoomStatus.All, + valueOf: RoomStatus.valueOf, + enumValues: RoomStatus.values) + ..e(4, _omitFieldNames ? '' : 'sort', $pb.PbFieldType.OE, + defaultOrMaker: RoomSortType.Default, + valueOf: RoomSortType.valueOf, + enumValues: RoomSortType.values) + ..a<$fixnum.Int64>(5, _omitFieldNames ? '' : 'pageNum', $pb.PbFieldType.OU6, + protoName: 'pageNum', defaultOrMaker: $fixnum.Int64.ZERO) + ..hasRequiredFields = false; - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') RoomListPageReqData clone() => RoomListPageReqData()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - RoomListPageReqData copyWith(void Function(RoomListPageReqData) updates) => super.copyWith((message) => updates(message as RoomListPageReqData)) as RoomListPageReqData; + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + RoomListPageReqData copyWith(void Function(RoomListPageReqData) updates) => + super.copyWith((message) => updates(message as RoomListPageReqData)) + as RoomListPageReqData; $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static RoomListPageReqData create() => RoomListPageReqData._(); RoomListPageReqData createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); + static $pb.PbList createRepeated() => + $pb.PbList(); @$core.pragma('dart2js:noInline') - static RoomListPageReqData getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static RoomListPageReqData getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); static RoomListPageReqData? _defaultInstance; @$pb.TagNumber(1) $core.String get typeID => $_getSZ(0); @$pb.TagNumber(1) - set typeID($core.String v) { $_setString(0, v); } + set typeID($core.String v) { + $_setString(0, v); + } + @$pb.TagNumber(1) $core.bool hasTypeID() => $_has(0); @$pb.TagNumber(1) @@ -776,7 +935,10 @@ class RoomListPageReqData extends $pb.GeneratedMessage { @$pb.TagNumber(2) $core.String get subTypeID => $_getSZ(1); @$pb.TagNumber(2) - set subTypeID($core.String v) { $_setString(1, v); } + set subTypeID($core.String v) { + $_setString(1, v); + } + @$pb.TagNumber(2) $core.bool hasSubTypeID() => $_has(1); @$pb.TagNumber(2) @@ -785,7 +947,10 @@ class RoomListPageReqData extends $pb.GeneratedMessage { @$pb.TagNumber(3) RoomStatus get status => $_getN(2); @$pb.TagNumber(3) - set status(RoomStatus v) { setField(3, v); } + set status(RoomStatus v) { + setField(3, v); + } + @$pb.TagNumber(3) $core.bool hasStatus() => $_has(2); @$pb.TagNumber(3) @@ -794,7 +959,10 @@ class RoomListPageReqData extends $pb.GeneratedMessage { @$pb.TagNumber(4) RoomSortType get sort => $_getN(3); @$pb.TagNumber(4) - set sort(RoomSortType v) { setField(4, v); } + set sort(RoomSortType v) { + setField(4, v); + } + @$pb.TagNumber(4) $core.bool hasSort() => $_has(3); @$pb.TagNumber(4) @@ -803,7 +971,10 @@ class RoomListPageReqData extends $pb.GeneratedMessage { @$pb.TagNumber(5) $fixnum.Int64 get pageNum => $_getI64(4); @$pb.TagNumber(5) - set pageNum($fixnum.Int64 v) { $_setInt64(4, v); } + set pageNum($fixnum.Int64 v) { + $_setInt64(4, v); + } + @$pb.TagNumber(5) $core.bool hasPageNum() => $_has(4); @$pb.TagNumber(5) @@ -825,40 +996,52 @@ class RoomListData extends $pb.GeneratedMessage { return $result; } RoomListData._() : super(); - factory RoomListData.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory RoomListData.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + factory RoomListData.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory RoomListData.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'RoomListData', createEmptyInstance: create) - ..aOM(1, _omitFieldNames ? '' : 'pageData', protoName: 'pageData', subBuilder: BasePageRespData.create) - ..pc(2, _omitFieldNames ? '' : 'rooms', $pb.PbFieldType.PM, subBuilder: RoomData.create) - ..hasRequiredFields = false - ; + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'RoomListData', + createEmptyInstance: create) + ..aOM(1, _omitFieldNames ? '' : 'pageData', + protoName: 'pageData', subBuilder: BasePageRespData.create) + ..pc(2, _omitFieldNames ? '' : 'rooms', $pb.PbFieldType.PM, + subBuilder: RoomData.create) + ..hasRequiredFields = false; - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') RoomListData clone() => RoomListData()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - RoomListData copyWith(void Function(RoomListData) updates) => super.copyWith((message) => updates(message as RoomListData)) as RoomListData; + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + RoomListData copyWith(void Function(RoomListData) updates) => + super.copyWith((message) => updates(message as RoomListData)) + as RoomListData; $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static RoomListData create() => RoomListData._(); RoomListData createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); + static $pb.PbList createRepeated() => + $pb.PbList(); @$core.pragma('dart2js:noInline') - static RoomListData getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static RoomListData getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); static RoomListData? _defaultInstance; @$pb.TagNumber(1) BasePageRespData get pageData => $_getN(0); @$pb.TagNumber(1) - set pageData(BasePageRespData v) { setField(1, v); } + set pageData(BasePageRespData v) { + setField(1, v); + } + @$pb.TagNumber(1) $core.bool hasPageData() => $_has(0); @$pb.TagNumber(1) @@ -889,26 +1072,30 @@ class PreUser extends $pb.GeneratedMessage { return $result; } PreUser._() : super(); - factory PreUser.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory PreUser.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + factory PreUser.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory PreUser.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'PreUser', createEmptyInstance: create) + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'PreUser', + createEmptyInstance: create) ..aOS(1, _omitFieldNames ? '' : 'userName', protoName: 'userName') ..aOS(2, _omitFieldNames ? '' : 'deviceUUID', protoName: 'deviceUUID') ..aOS(3, _omitFieldNames ? '' : 'roomID', protoName: 'roomID') - ..hasRequiredFields = false - ; + ..hasRequiredFields = false; - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') PreUser clone() => PreUser()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - PreUser copyWith(void Function(PreUser) updates) => super.copyWith((message) => updates(message as PreUser)) as PreUser; + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + PreUser copyWith(void Function(PreUser) updates) => + super.copyWith((message) => updates(message as PreUser)) as PreUser; $pb.BuilderInfo get info_ => _i; @@ -917,13 +1104,17 @@ class PreUser extends $pb.GeneratedMessage { PreUser createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') - static PreUser getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static PreUser getDefault() => + _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static PreUser? _defaultInstance; @$pb.TagNumber(1) $core.String get userName => $_getSZ(0); @$pb.TagNumber(1) - set userName($core.String v) { $_setString(0, v); } + set userName($core.String v) { + $_setString(0, v); + } + @$pb.TagNumber(1) $core.bool hasUserName() => $_has(0); @$pb.TagNumber(1) @@ -932,7 +1123,10 @@ class PreUser extends $pb.GeneratedMessage { @$pb.TagNumber(2) $core.String get deviceUUID => $_getSZ(1); @$pb.TagNumber(2) - set deviceUUID($core.String v) { $_setString(1, v); } + set deviceUUID($core.String v) { + $_setString(1, v); + } + @$pb.TagNumber(2) $core.bool hasDeviceUUID() => $_has(1); @$pb.TagNumber(2) @@ -941,7 +1135,10 @@ class PreUser extends $pb.GeneratedMessage { @$pb.TagNumber(3) $core.String get roomID => $_getSZ(2); @$pb.TagNumber(3) - set roomID($core.String v) { $_setString(2, v); } + set roomID($core.String v) { + $_setString(2, v); + } + @$pb.TagNumber(3) $core.bool hasRoomID() => $_has(2); @$pb.TagNumber(3) @@ -971,42 +1168,55 @@ class RoomUserData extends $pb.GeneratedMessage { return $result; } RoomUserData._() : super(); - factory RoomUserData.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory RoomUserData.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + factory RoomUserData.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory RoomUserData.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'RoomUserData', createEmptyInstance: create) + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'RoomUserData', + createEmptyInstance: create) ..aOS(1, _omitFieldNames ? '' : 'id') ..aOS(2, _omitFieldNames ? '' : 'playerName', protoName: 'playerName') ..aOS(3, _omitFieldNames ? '' : 'Avatar', protoName: 'Avatar') - ..e(4, _omitFieldNames ? '' : 'status', $pb.PbFieldType.OE, defaultOrMaker: RoomUserStatus.RoomUserStatusJoin, valueOf: RoomUserStatus.valueOf, enumValues: RoomUserStatus.values) - ..hasRequiredFields = false - ; + ..e(4, _omitFieldNames ? '' : 'status', $pb.PbFieldType.OE, + defaultOrMaker: RoomUserStatus.RoomUserStatusJoin, + valueOf: RoomUserStatus.valueOf, + enumValues: RoomUserStatus.values) + ..hasRequiredFields = false; - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') RoomUserData clone() => RoomUserData()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - RoomUserData copyWith(void Function(RoomUserData) updates) => super.copyWith((message) => updates(message as RoomUserData)) as RoomUserData; + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + RoomUserData copyWith(void Function(RoomUserData) updates) => + super.copyWith((message) => updates(message as RoomUserData)) + as RoomUserData; $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static RoomUserData create() => RoomUserData._(); RoomUserData createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); + static $pb.PbList createRepeated() => + $pb.PbList(); @$core.pragma('dart2js:noInline') - static RoomUserData getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static RoomUserData getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); static RoomUserData? _defaultInstance; @$pb.TagNumber(1) $core.String get id => $_getSZ(0); @$pb.TagNumber(1) - set id($core.String v) { $_setString(0, v); } + set id($core.String v) { + $_setString(0, v); + } + @$pb.TagNumber(1) $core.bool hasId() => $_has(0); @$pb.TagNumber(1) @@ -1015,7 +1225,10 @@ class RoomUserData extends $pb.GeneratedMessage { @$pb.TagNumber(2) $core.String get playerName => $_getSZ(1); @$pb.TagNumber(2) - set playerName($core.String v) { $_setString(1, v); } + set playerName($core.String v) { + $_setString(1, v); + } + @$pb.TagNumber(2) $core.bool hasPlayerName() => $_has(1); @$pb.TagNumber(2) @@ -1024,7 +1237,10 @@ class RoomUserData extends $pb.GeneratedMessage { @$pb.TagNumber(3) $core.String get avatar => $_getSZ(2); @$pb.TagNumber(3) - set avatar($core.String v) { $_setString(2, v); } + set avatar($core.String v) { + $_setString(2, v); + } + @$pb.TagNumber(3) $core.bool hasAvatar() => $_has(2); @$pb.TagNumber(3) @@ -1033,7 +1249,10 @@ class RoomUserData extends $pb.GeneratedMessage { @$pb.TagNumber(4) RoomUserStatus get status => $_getN(3); @$pb.TagNumber(4) - set status(RoomUserStatus v) { setField(4, v); } + set status(RoomUserStatus v) { + setField(4, v); + } + @$pb.TagNumber(4) $core.bool hasStatus() => $_has(3); @$pb.TagNumber(4) @@ -1059,41 +1278,59 @@ class RoomUpdateMessage extends $pb.GeneratedMessage { return $result; } RoomUpdateMessage._() : super(); - factory RoomUpdateMessage.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory RoomUpdateMessage.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + factory RoomUpdateMessage.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory RoomUpdateMessage.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'RoomUpdateMessage', createEmptyInstance: create) - ..aOM(1, _omitFieldNames ? '' : 'roomData', protoName: 'roomData', subBuilder: RoomData.create) - ..pc(2, _omitFieldNames ? '' : 'usersData', $pb.PbFieldType.PM, protoName: 'usersData', subBuilder: RoomUserData.create) - ..e(3, _omitFieldNames ? '' : 'roomUpdateType', $pb.PbFieldType.OE, protoName: 'roomUpdateType', defaultOrMaker: RoomUpdateType.RoomUpdateData, valueOf: RoomUpdateType.valueOf, enumValues: RoomUpdateType.values) - ..hasRequiredFields = false - ; + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'RoomUpdateMessage', + createEmptyInstance: create) + ..aOM(1, _omitFieldNames ? '' : 'roomData', + protoName: 'roomData', subBuilder: RoomData.create) + ..pc( + 2, _omitFieldNames ? '' : 'usersData', $pb.PbFieldType.PM, + protoName: 'usersData', subBuilder: RoomUserData.create) + ..e( + 3, _omitFieldNames ? '' : 'roomUpdateType', $pb.PbFieldType.OE, + protoName: 'roomUpdateType', + defaultOrMaker: RoomUpdateType.RoomUpdateData, + valueOf: RoomUpdateType.valueOf, + enumValues: RoomUpdateType.values) + ..hasRequiredFields = false; - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') RoomUpdateMessage clone() => RoomUpdateMessage()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - RoomUpdateMessage copyWith(void Function(RoomUpdateMessage) updates) => super.copyWith((message) => updates(message as RoomUpdateMessage)) as RoomUpdateMessage; + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + RoomUpdateMessage copyWith(void Function(RoomUpdateMessage) updates) => + super.copyWith((message) => updates(message as RoomUpdateMessage)) + as RoomUpdateMessage; $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static RoomUpdateMessage create() => RoomUpdateMessage._(); RoomUpdateMessage createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); + static $pb.PbList createRepeated() => + $pb.PbList(); @$core.pragma('dart2js:noInline') - static RoomUpdateMessage getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static RoomUpdateMessage getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); static RoomUpdateMessage? _defaultInstance; @$pb.TagNumber(1) RoomData get roomData => $_getN(0); @$pb.TagNumber(1) - set roomData(RoomData v) { setField(1, v); } + set roomData(RoomData v) { + setField(1, v); + } + @$pb.TagNumber(1) $core.bool hasRoomData() => $_has(0); @$pb.TagNumber(1) @@ -1107,13 +1344,16 @@ class RoomUpdateMessage extends $pb.GeneratedMessage { @$pb.TagNumber(3) RoomUpdateType get roomUpdateType => $_getN(2); @$pb.TagNumber(3) - set roomUpdateType(RoomUpdateType v) { setField(3, v); } + set roomUpdateType(RoomUpdateType v) { + setField(3, v); + } + @$pb.TagNumber(3) $core.bool hasRoomUpdateType() => $_has(2); @$pb.TagNumber(3) void clearRoomUpdateType() => clearField(3); } - const _omitFieldNames = $core.bool.fromEnvironment('protobuf.omit_field_names'); -const _omitMessageNames = $core.bool.fromEnvironment('protobuf.omit_message_names'); +const _omitMessageNames = + $core.bool.fromEnvironment('protobuf.omit_message_names'); diff --git a/lib/generated/grpc/party_room_server/index.pbenum.dart b/lib/generated/grpc/party_room_server/index.pbenum.dart index bd7403a..34fe2f8 100644 --- a/lib/generated/grpc/party_room_server/index.pbenum.dart +++ b/lib/generated/grpc/party_room_server/index.pbenum.dart @@ -16,13 +16,17 @@ import 'package:protobuf/protobuf.dart' as $pb; class RoomStatus extends $pb.ProtobufEnum { static const RoomStatus All = RoomStatus._(0, _omitEnumNames ? '' : 'All'); static const RoomStatus Open = RoomStatus._(1, _omitEnumNames ? '' : 'Open'); - static const RoomStatus Private = RoomStatus._(2, _omitEnumNames ? '' : 'Private'); + static const RoomStatus Private = + RoomStatus._(2, _omitEnumNames ? '' : 'Private'); static const RoomStatus Full = RoomStatus._(3, _omitEnumNames ? '' : 'Full'); - static const RoomStatus Closed = RoomStatus._(4, _omitEnumNames ? '' : 'Closed'); - static const RoomStatus WillOffline = RoomStatus._(5, _omitEnumNames ? '' : 'WillOffline'); - static const RoomStatus Offline = RoomStatus._(6, _omitEnumNames ? '' : 'Offline'); + static const RoomStatus Closed = + RoomStatus._(4, _omitEnumNames ? '' : 'Closed'); + static const RoomStatus WillOffline = + RoomStatus._(5, _omitEnumNames ? '' : 'WillOffline'); + static const RoomStatus Offline = + RoomStatus._(6, _omitEnumNames ? '' : 'Offline'); - static const $core.List values = [ + static const $core.List values = [ All, Open, Private, @@ -32,20 +36,26 @@ class RoomStatus extends $pb.ProtobufEnum { Offline, ]; - static final $core.Map<$core.int, RoomStatus> _byValue = $pb.ProtobufEnum.initByValue(values); + static final $core.Map<$core.int, RoomStatus> _byValue = + $pb.ProtobufEnum.initByValue(values); static RoomStatus? valueOf($core.int value) => _byValue[value]; const RoomStatus._($core.int v, $core.String n) : super(v, n); } class RoomSortType extends $pb.ProtobufEnum { - static const RoomSortType Default = RoomSortType._(0, _omitEnumNames ? '' : 'Default'); - static const RoomSortType MostPlayerNumber = RoomSortType._(1, _omitEnumNames ? '' : 'MostPlayerNumber'); - static const RoomSortType MinimumPlayerNumber = RoomSortType._(2, _omitEnumNames ? '' : 'MinimumPlayerNumber'); - static const RoomSortType RecentlyCreated = RoomSortType._(3, _omitEnumNames ? '' : 'RecentlyCreated'); - static const RoomSortType OldestCreated = RoomSortType._(4, _omitEnumNames ? '' : 'OldestCreated'); + static const RoomSortType Default = + RoomSortType._(0, _omitEnumNames ? '' : 'Default'); + static const RoomSortType MostPlayerNumber = + RoomSortType._(1, _omitEnumNames ? '' : 'MostPlayerNumber'); + static const RoomSortType MinimumPlayerNumber = + RoomSortType._(2, _omitEnumNames ? '' : 'MinimumPlayerNumber'); + static const RoomSortType RecentlyCreated = + RoomSortType._(3, _omitEnumNames ? '' : 'RecentlyCreated'); + static const RoomSortType OldestCreated = + RoomSortType._(4, _omitEnumNames ? '' : 'OldestCreated'); - static const $core.List values = [ + static const $core.List values = [ Default, MostPlayerNumber, MinimumPlayerNumber, @@ -53,45 +63,53 @@ class RoomSortType extends $pb.ProtobufEnum { OldestCreated, ]; - static final $core.Map<$core.int, RoomSortType> _byValue = $pb.ProtobufEnum.initByValue(values); + static final $core.Map<$core.int, RoomSortType> _byValue = + $pb.ProtobufEnum.initByValue(values); static RoomSortType? valueOf($core.int value) => _byValue[value]; const RoomSortType._($core.int v, $core.String n) : super(v, n); } class RoomUserStatus extends $pb.ProtobufEnum { - static const RoomUserStatus RoomUserStatusJoin = RoomUserStatus._(0, _omitEnumNames ? '' : 'RoomUserStatusJoin'); - static const RoomUserStatus RoomUserStatusLostOffline = RoomUserStatus._(1, _omitEnumNames ? '' : 'RoomUserStatusLostOffline'); - static const RoomUserStatus RoomUserStatusLeave = RoomUserStatus._(2, _omitEnumNames ? '' : 'RoomUserStatusLeave'); - static const RoomUserStatus RoomUserStatusWaitingConnect = RoomUserStatus._(3, _omitEnumNames ? '' : 'RoomUserStatusWaitingConnect'); + static const RoomUserStatus RoomUserStatusJoin = + RoomUserStatus._(0, _omitEnumNames ? '' : 'RoomUserStatusJoin'); + static const RoomUserStatus RoomUserStatusLostOffline = + RoomUserStatus._(1, _omitEnumNames ? '' : 'RoomUserStatusLostOffline'); + static const RoomUserStatus RoomUserStatusLeave = + RoomUserStatus._(2, _omitEnumNames ? '' : 'RoomUserStatusLeave'); + static const RoomUserStatus RoomUserStatusWaitingConnect = + RoomUserStatus._(3, _omitEnumNames ? '' : 'RoomUserStatusWaitingConnect'); - static const $core.List values = [ + static const $core.List values = [ RoomUserStatusJoin, RoomUserStatusLostOffline, RoomUserStatusLeave, RoomUserStatusWaitingConnect, ]; - static final $core.Map<$core.int, RoomUserStatus> _byValue = $pb.ProtobufEnum.initByValue(values); + static final $core.Map<$core.int, RoomUserStatus> _byValue = + $pb.ProtobufEnum.initByValue(values); static RoomUserStatus? valueOf($core.int value) => _byValue[value]; const RoomUserStatus._($core.int v, $core.String n) : super(v, n); } class RoomUpdateType extends $pb.ProtobufEnum { - static const RoomUpdateType RoomUpdateData = RoomUpdateType._(0, _omitEnumNames ? '' : 'RoomUpdateData'); - static const RoomUpdateType RoomClose = RoomUpdateType._(1, _omitEnumNames ? '' : 'RoomClose'); + static const RoomUpdateType RoomUpdateData = + RoomUpdateType._(0, _omitEnumNames ? '' : 'RoomUpdateData'); + static const RoomUpdateType RoomClose = + RoomUpdateType._(1, _omitEnumNames ? '' : 'RoomClose'); - static const $core.List values = [ + static const $core.List values = [ RoomUpdateData, RoomClose, ]; - static final $core.Map<$core.int, RoomUpdateType> _byValue = $pb.ProtobufEnum.initByValue(values); + static final $core.Map<$core.int, RoomUpdateType> _byValue = + $pb.ProtobufEnum.initByValue(values); static RoomUpdateType? valueOf($core.int value) => _byValue[value]; const RoomUpdateType._($core.int v, $core.String n) : super(v, n); } - const _omitEnumNames = $core.bool.fromEnvironment('protobuf.omit_enum_names'); diff --git a/lib/generated/grpc/party_room_server/index.pbgrpc.dart b/lib/generated/grpc/party_room_server/index.pbgrpc.dart index cb22f8f..8501d93 100644 --- a/lib/generated/grpc/party_room_server/index.pbgrpc.dart +++ b/lib/generated/grpc/party_room_server/index.pbgrpc.dart @@ -33,18 +33,21 @@ class IndexServiceClient extends $grpc.Client { '/IndexService/CreateRoom', ($0.RoomData value) => value.writeToBuffer(), ($core.List<$core.int> value) => $0.RoomData.fromBuffer(value)); - static final _$getRoomList = $grpc.ClientMethod<$0.RoomListPageReqData, $0.RoomListData>( - '/IndexService/GetRoomList', - ($0.RoomListPageReqData value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.RoomListData.fromBuffer(value)); + static final _$getRoomList = + $grpc.ClientMethod<$0.RoomListPageReqData, $0.RoomListData>( + '/IndexService/GetRoomList', + ($0.RoomListPageReqData value) => value.writeToBuffer(), + ($core.List<$core.int> value) => $0.RoomListData.fromBuffer(value)); static final _$touchUser = $grpc.ClientMethod<$0.PreUser, $0.RoomData>( '/IndexService/TouchUser', ($0.PreUser value) => value.writeToBuffer(), ($core.List<$core.int> value) => $0.RoomData.fromBuffer(value)); - static final _$joinRoom = $grpc.ClientMethod<$0.PreUser, $0.RoomUpdateMessage>( - '/IndexService/JoinRoom', - ($0.PreUser value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.RoomUpdateMessage.fromBuffer(value)); + static final _$joinRoom = + $grpc.ClientMethod<$0.PreUser, $0.RoomUpdateMessage>( + '/IndexService/JoinRoom', + ($0.PreUser value) => value.writeToBuffer(), + ($core.List<$core.int> value) => + $0.RoomUpdateMessage.fromBuffer(value)); static final _$leaveRoom = $grpc.ClientMethod<$0.PreUser, $0.BaseRespData>( '/IndexService/LeaveRoom', ($0.PreUser value) => value.writeToBuffer(), @@ -53,34 +56,43 @@ class IndexServiceClient extends $grpc.Client { IndexServiceClient($grpc.ClientChannel channel, {$grpc.CallOptions? options, $core.Iterable<$grpc.ClientInterceptor>? interceptors}) - : super(channel, options: options, - interceptors: interceptors); + : super(channel, options: options, interceptors: interceptors); - $grpc.ResponseFuture<$0.PingData> pingServer($0.PingData request, {$grpc.CallOptions? options}) { + $grpc.ResponseFuture<$0.PingData> pingServer($0.PingData request, + {$grpc.CallOptions? options}) { return $createUnaryCall(_$pingServer, request, options: options); } - $grpc.ResponseFuture<$0.RoomTypesData> getRoomTypes($0.Empty request, {$grpc.CallOptions? options}) { + $grpc.ResponseFuture<$0.RoomTypesData> getRoomTypes($0.Empty request, + {$grpc.CallOptions? options}) { return $createUnaryCall(_$getRoomTypes, request, options: options); } - $grpc.ResponseFuture<$0.RoomData> createRoom($0.RoomData request, {$grpc.CallOptions? options}) { + $grpc.ResponseFuture<$0.RoomData> createRoom($0.RoomData request, + {$grpc.CallOptions? options}) { return $createUnaryCall(_$createRoom, request, options: options); } - $grpc.ResponseFuture<$0.RoomListData> getRoomList($0.RoomListPageReqData request, {$grpc.CallOptions? options}) { + $grpc.ResponseFuture<$0.RoomListData> getRoomList( + $0.RoomListPageReqData request, + {$grpc.CallOptions? options}) { return $createUnaryCall(_$getRoomList, request, options: options); } - $grpc.ResponseFuture<$0.RoomData> touchUser($0.PreUser request, {$grpc.CallOptions? options}) { + $grpc.ResponseFuture<$0.RoomData> touchUser($0.PreUser request, + {$grpc.CallOptions? options}) { return $createUnaryCall(_$touchUser, request, options: options); } - $grpc.ResponseStream<$0.RoomUpdateMessage> joinRoom($0.PreUser request, {$grpc.CallOptions? options}) { - return $createStreamingCall(_$joinRoom, $async.Stream.fromIterable([request]), options: options); + $grpc.ResponseStream<$0.RoomUpdateMessage> joinRoom($0.PreUser request, + {$grpc.CallOptions? options}) { + return $createStreamingCall( + _$joinRoom, $async.Stream.fromIterable([request]), + options: options); } - $grpc.ResponseFuture<$0.BaseRespData> leaveRoom($0.PreUser request, {$grpc.CallOptions? options}) { + $grpc.ResponseFuture<$0.BaseRespData> leaveRoom($0.PreUser request, + {$grpc.CallOptions? options}) { return $createUnaryCall(_$leaveRoom, request, options: options); } } @@ -116,7 +128,8 @@ abstract class IndexServiceBase extends $grpc.Service { getRoomList_Pre, false, false, - ($core.List<$core.int> value) => $0.RoomListPageReqData.fromBuffer(value), + ($core.List<$core.int> value) => + $0.RoomListPageReqData.fromBuffer(value), ($0.RoomListData value) => value.writeToBuffer())); $addMethod($grpc.ServiceMethod<$0.PreUser, $0.RoomData>( 'TouchUser', @@ -141,39 +154,53 @@ abstract class IndexServiceBase extends $grpc.Service { ($0.BaseRespData value) => value.writeToBuffer())); } - $async.Future<$0.PingData> pingServer_Pre($grpc.ServiceCall call, $async.Future<$0.PingData> request) async { + $async.Future<$0.PingData> pingServer_Pre( + $grpc.ServiceCall call, $async.Future<$0.PingData> request) async { return pingServer(call, await request); } - $async.Future<$0.RoomTypesData> getRoomTypes_Pre($grpc.ServiceCall call, $async.Future<$0.Empty> request) async { + $async.Future<$0.RoomTypesData> getRoomTypes_Pre( + $grpc.ServiceCall call, $async.Future<$0.Empty> request) async { return getRoomTypes(call, await request); } - $async.Future<$0.RoomData> createRoom_Pre($grpc.ServiceCall call, $async.Future<$0.RoomData> request) async { + $async.Future<$0.RoomData> createRoom_Pre( + $grpc.ServiceCall call, $async.Future<$0.RoomData> request) async { return createRoom(call, await request); } - $async.Future<$0.RoomListData> getRoomList_Pre($grpc.ServiceCall call, $async.Future<$0.RoomListPageReqData> request) async { + $async.Future<$0.RoomListData> getRoomList_Pre($grpc.ServiceCall call, + $async.Future<$0.RoomListPageReqData> request) async { return getRoomList(call, await request); } - $async.Future<$0.RoomData> touchUser_Pre($grpc.ServiceCall call, $async.Future<$0.PreUser> request) async { + $async.Future<$0.RoomData> touchUser_Pre( + $grpc.ServiceCall call, $async.Future<$0.PreUser> request) async { return touchUser(call, await request); } - $async.Stream<$0.RoomUpdateMessage> joinRoom_Pre($grpc.ServiceCall call, $async.Future<$0.PreUser> request) async* { + $async.Stream<$0.RoomUpdateMessage> joinRoom_Pre( + $grpc.ServiceCall call, $async.Future<$0.PreUser> request) async* { yield* joinRoom(call, await request); } - $async.Future<$0.BaseRespData> leaveRoom_Pre($grpc.ServiceCall call, $async.Future<$0.PreUser> request) async { + $async.Future<$0.BaseRespData> leaveRoom_Pre( + $grpc.ServiceCall call, $async.Future<$0.PreUser> request) async { return leaveRoom(call, await request); } - $async.Future<$0.PingData> pingServer($grpc.ServiceCall call, $0.PingData request); - $async.Future<$0.RoomTypesData> getRoomTypes($grpc.ServiceCall call, $0.Empty request); - $async.Future<$0.RoomData> createRoom($grpc.ServiceCall call, $0.RoomData request); - $async.Future<$0.RoomListData> getRoomList($grpc.ServiceCall call, $0.RoomListPageReqData request); - $async.Future<$0.RoomData> touchUser($grpc.ServiceCall call, $0.PreUser request); - $async.Stream<$0.RoomUpdateMessage> joinRoom($grpc.ServiceCall call, $0.PreUser request); - $async.Future<$0.BaseRespData> leaveRoom($grpc.ServiceCall call, $0.PreUser request); + $async.Future<$0.PingData> pingServer( + $grpc.ServiceCall call, $0.PingData request); + $async.Future<$0.RoomTypesData> getRoomTypes( + $grpc.ServiceCall call, $0.Empty request); + $async.Future<$0.RoomData> createRoom( + $grpc.ServiceCall call, $0.RoomData request); + $async.Future<$0.RoomListData> getRoomList( + $grpc.ServiceCall call, $0.RoomListPageReqData request); + $async.Future<$0.RoomData> touchUser( + $grpc.ServiceCall call, $0.PreUser request); + $async.Stream<$0.RoomUpdateMessage> joinRoom( + $grpc.ServiceCall call, $0.PreUser request); + $async.Future<$0.BaseRespData> leaveRoom( + $grpc.ServiceCall call, $0.PreUser request); } diff --git a/lib/generated/grpc/party_room_server/index.pbjson.dart b/lib/generated/grpc/party_room_server/index.pbjson.dart index 5f2a4c6..d599efc 100644 --- a/lib/generated/grpc/party_room_server/index.pbjson.dart +++ b/lib/generated/grpc/party_room_server/index.pbjson.dart @@ -86,8 +86,8 @@ const Empty$json = { }; /// Descriptor for `Empty`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List emptyDescriptor = $convert.base64Decode( - 'CgVFbXB0eQ=='); +final $typed_data.Uint8List emptyDescriptor = + $convert.base64Decode('CgVFbXB0eQ=='); @$core.Deprecated('Use baseRespDataDescriptor instead') const BaseRespData$json = { @@ -140,7 +140,14 @@ final $typed_data.Uint8List pingDataDescriptor = $convert.base64Decode( const RoomTypesData$json = { '1': 'RoomTypesData', '2': [ - {'1': 'roomTypes', '3': 1, '4': 3, '5': 11, '6': '.RoomType', '10': 'roomTypes'}, + { + '1': 'roomTypes', + '3': 1, + '4': 3, + '5': 11, + '6': '.RoomType', + '10': 'roomTypes' + }, ], }; @@ -157,7 +164,14 @@ const RoomType$json = { {'1': 'name', '3': 2, '4': 1, '5': 9, '10': 'name'}, {'1': 'icon', '3': 3, '4': 1, '5': 9, '10': 'icon'}, {'1': 'desc', '3': 4, '4': 1, '5': 9, '10': 'desc'}, - {'1': 'subTypes', '3': 5, '4': 3, '5': 11, '6': '.RoomSubtype', '10': 'subTypes'}, + { + '1': 'subTypes', + '3': 5, + '4': 3, + '5': 11, + '6': '.RoomSubtype', + '10': 'subTypes' + }, ], }; @@ -191,7 +205,14 @@ const RoomData$json = { {'1': 'maxPlayer', '3': 5, '4': 1, '5': 5, '10': 'maxPlayer'}, {'1': 'createTime', '3': 6, '4': 1, '5': 3, '10': 'createTime'}, {'1': 'curPlayer', '3': 7, '4': 1, '5': 5, '10': 'curPlayer'}, - {'1': 'status', '3': 8, '4': 1, '5': 14, '6': '.RoomStatus', '10': 'status'}, + { + '1': 'status', + '3': 8, + '4': 1, + '5': 14, + '6': '.RoomStatus', + '10': 'status' + }, {'1': 'deviceUUID', '3': 9, '4': 1, '5': 9, '10': 'deviceUUID'}, {'1': 'announcement', '3': 10, '4': 1, '5': 9, '10': 'announcement'}, {'1': 'avatar', '3': 11, '4': 1, '5': 9, '10': 'avatar'}, @@ -215,7 +236,14 @@ const RoomListPageReqData$json = { '2': [ {'1': 'typeID', '3': 1, '4': 1, '5': 9, '10': 'typeID'}, {'1': 'subTypeID', '3': 2, '4': 1, '5': 9, '10': 'subTypeID'}, - {'1': 'status', '3': 3, '4': 1, '5': 14, '6': '.RoomStatus', '10': 'status'}, + { + '1': 'status', + '3': 3, + '4': 1, + '5': 14, + '6': '.RoomStatus', + '10': 'status' + }, {'1': 'sort', '3': 4, '4': 1, '5': 14, '6': '.RoomSortType', '10': 'sort'}, {'1': 'pageNum', '3': 5, '4': 1, '5': 4, '10': 'pageNum'}, ], @@ -232,7 +260,14 @@ final $typed_data.Uint8List roomListPageReqDataDescriptor = $convert.base64Decod const RoomListData$json = { '1': 'RoomListData', '2': [ - {'1': 'pageData', '3': 1, '4': 1, '5': 11, '6': '.BasePageRespData', '10': 'pageData'}, + { + '1': 'pageData', + '3': 1, + '4': 1, + '5': 11, + '6': '.BasePageRespData', + '10': 'pageData' + }, {'1': 'rooms', '3': 2, '4': 3, '5': 11, '6': '.RoomData', '10': 'rooms'}, ], }; @@ -264,7 +299,14 @@ const RoomUserData$json = { {'1': 'id', '3': 1, '4': 1, '5': 9, '10': 'id'}, {'1': 'playerName', '3': 2, '4': 1, '5': 9, '10': 'playerName'}, {'1': 'Avatar', '3': 3, '4': 1, '5': 9, '10': 'Avatar'}, - {'1': 'status', '3': 4, '4': 1, '5': 14, '6': '.RoomUserStatus', '10': 'status'}, + { + '1': 'status', + '3': 4, + '4': 1, + '5': 14, + '6': '.RoomUserStatus', + '10': 'status' + }, ], }; @@ -278,9 +320,30 @@ final $typed_data.Uint8List roomUserDataDescriptor = $convert.base64Decode( const RoomUpdateMessage$json = { '1': 'RoomUpdateMessage', '2': [ - {'1': 'roomData', '3': 1, '4': 1, '5': 11, '6': '.RoomData', '10': 'roomData'}, - {'1': 'usersData', '3': 2, '4': 3, '5': 11, '6': '.RoomUserData', '10': 'usersData'}, - {'1': 'roomUpdateType', '3': 3, '4': 1, '5': 14, '6': '.RoomUpdateType', '10': 'roomUpdateType'}, + { + '1': 'roomData', + '3': 1, + '4': 1, + '5': 11, + '6': '.RoomData', + '10': 'roomData' + }, + { + '1': 'usersData', + '3': 2, + '4': 3, + '5': 11, + '6': '.RoomUserData', + '10': 'usersData' + }, + { + '1': 'roomUpdateType', + '3': 3, + '4': 1, + '5': 14, + '6': '.RoomUpdateType', + '10': 'roomUpdateType' + }, ], }; @@ -289,4 +352,3 @@ final $typed_data.Uint8List roomUpdateMessageDescriptor = $convert.base64Decode( 'ChFSb29tVXBkYXRlTWVzc2FnZRIlCghyb29tRGF0YRgBIAEoCzIJLlJvb21EYXRhUghyb29tRG' 'F0YRIrCgl1c2Vyc0RhdGEYAiADKAsyDS5Sb29tVXNlckRhdGFSCXVzZXJzRGF0YRI3Cg5yb29t' 'VXBkYXRlVHlwZRgDIAEoDjIPLlJvb21VcGRhdGVUeXBlUg5yb29tVXBkYXRlVHlwZQ=='); - diff --git a/lib/main.dart b/lib/main.dart index 6260195..1406c37 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,12 +1,12 @@ import 'package:desktop_webview_window/desktop_webview_window.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:starcitizen_doctor/base/ui_model.dart'; -import 'package:starcitizen_doctor/common/conf/app_conf.dart'; -import 'package:starcitizen_doctor/ui/splash_ui_model.dart'; import 'package:window_manager/window_manager.dart'; +import 'base/ui_model.dart'; +import 'common/conf/app_conf.dart'; import 'global_ui_model.dart'; import 'ui/splash_ui.dart'; +import 'ui/splash_ui_model.dart'; void main(List args) async { if (runWebViewTitleBarWidget(args, diff --git a/lib/ui/party_room/party_room_home_ui_model.dart b/lib/ui/party_room/party_room_home_ui_model.dart index 7ac718a..9ddc2d4 100644 --- a/lib/ui/party_room/party_room_home_ui_model.dart +++ b/lib/ui/party_room/party_room_home_ui_model.dart @@ -41,7 +41,6 @@ class PartyRoomHomeUIModel extends BaseUIModel { final pageCtrl = PageController(); - @override BaseUIModel? onCreateChildUIModel(modelKey) { switch (modelKey) { diff --git a/lib/ui/tools/downloader/downloader_dialog_ui_model.dart b/lib/ui/tools/downloader/downloader_dialog_ui_model.dart index df39f93..d09e506 100644 --- a/lib/ui/tools/downloader/downloader_dialog_ui_model.dart +++ b/lib/ui/tools/downloader/downloader_dialog_ui_model.dart @@ -3,7 +3,9 @@ import 'dart:io'; import 'package:file_picker/file_picker.dart'; import 'package:hive/hive.dart'; import 'package:starcitizen_doctor/base/ui_model.dart'; -import 'package:starcitizen_doctor/common/rust/ffi.dart'; +import 'package:starcitizen_doctor/common/rust/api/downloader_api.dart' + as rust_downloader; +import 'package:starcitizen_doctor/common/rust/downloader.dart'; class DownloaderDialogUIModel extends BaseUIModel { final String fileName; @@ -66,7 +68,7 @@ class DownloaderDialogUIModel extends BaseUIModel { final downloaderSavePath = "$savePath//$fileName.downloading"; try { - rustFii + rust_downloader .startDownload( url: downloadUrl, savePath: savePath, @@ -112,10 +114,10 @@ class DownloaderDialogUIModel extends BaseUIModel { } } - doCancel() { + doCancel() async { try { if (downloadTaskId != null) { - rustFii.cancelDownload(id: downloadTaskId!); + await rust_downloader.cancelDownload(id: downloadTaskId!); downloadTaskId = null; } else { Navigator.pop(context!, "cancel"); diff --git a/pubspec.yaml b/pubspec.yaml index 8c7ec40..08c9513 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -55,7 +55,7 @@ dependencies: flutter_tilt: ^2.0.10 card_swiper: ^3.0.1 ffi: ^2.1.0 - flutter_rust_bridge: ^1.82.3 + flutter_rust_bridge: 2.0.0-dev.23 freezed_annotation: ^2.4.1 meta: ^1.9.1 win32: ^5.0.9 @@ -70,6 +70,8 @@ dependencies: fixnum: ^1.1.0 protobuf: ^3.1.0 grpc: ^3.2.4 + rust_builder: + path: rust_builder dependency_overrides: http: ^1.1.2 @@ -85,7 +87,6 @@ dev_dependencies: # rules and activating additional ones. flutter_lints: ^3.0.0 msix: ^3.16.4 - ffigen: ^11.0.0 build_runner: ^2.4.6 freezed: ^2.4.5 diff --git a/rust/.gitignore b/rust/.gitignore new file mode 100644 index 0000000..ea8c4bf --- /dev/null +++ b/rust/.gitignore @@ -0,0 +1 @@ +/target diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 051e52a..cb61fbe 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -1,16 +1,15 @@ [package] -name = "rust" +name = "rust_lib" version = "0.1.0" edition = "2021" [lib] -crate-type = ["staticlib", "cdylib"] -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +crate-type = ["cdylib", "staticlib"] [dependencies] -flutter_rust_bridge = "1" +flutter_rust_bridge = "=2.0.0-dev.23" http-downloader = { version = "0.3.2", features = ["status-tracker", "speed-tracker", "breakpoint-resume", "bson-file-archiver"] } tokio = { version = "1", features = ["rt", "rt-multi-thread", "macros"] } -url = "2.4.1" -uuid = { version = "1.5.0", features = ["v4", "fast-rng", "macro-diagnostics"] } +url = "2.5.0" +uuid = { version = "1.7.0", features = ["v4", "fast-rng", "macro-diagnostics"] } async-std = "1.12.0" diff --git a/rust/src/api.rs b/rust/src/api/downloader_api.rs similarity index 62% rename from rust/src/api.rs rename to rust/src/api/downloader_api.rs index e0a9802..02f471b 100644 --- a/rust/src/api.rs +++ b/rust/src/api/downloader_api.rs @@ -1,16 +1,11 @@ use std::sync::Arc; -use async_std::task; -use flutter_rust_bridge::StreamSink; use crate::downloader::{do_cancel_download, do_start_download, DownloadCallbackData}; - -pub fn ping() -> String { - return String::from("PONG"); -} +use crate::frb_generated::StreamSink; pub fn start_download(url: String, save_path: String, file_name: String, connection_count: u8, sink: StreamSink) { let _ = do_start_download(url, save_path, file_name, connection_count, Arc::new(sink)); } -pub fn cancel_download(id: String) { - task::block_on(do_cancel_download(&id)) +pub async fn cancel_download(id: String) { + do_cancel_download(&id).await } \ No newline at end of file diff --git a/rust/src/api/mod.rs b/rust/src/api/mod.rs new file mode 100644 index 0000000..5e82520 --- /dev/null +++ b/rust/src/api/mod.rs @@ -0,0 +1,5 @@ +// +// Do not put code in `mod.rs`, but put in e.g. `simple.rs`. +// + +pub mod downloader_api; diff --git a/rust/src/bridge_generated.io.rs b/rust/src/bridge_generated.io.rs deleted file mode 100644 index 8317adb..0000000 --- a/rust/src/bridge_generated.io.rs +++ /dev/null @@ -1,83 +0,0 @@ -use super::*; -// Section: wire functions - -#[no_mangle] -pub extern "C" fn wire_ping(port_: i64) { - wire_ping_impl(port_) -} - -#[no_mangle] -pub extern "C" fn wire_start_download( - port_: i64, - url: *mut wire_uint_8_list, - save_path: *mut wire_uint_8_list, - file_name: *mut wire_uint_8_list, - connection_count: u8, -) { - wire_start_download_impl(port_, url, save_path, file_name, connection_count) -} - -#[no_mangle] -pub extern "C" fn wire_cancel_download(port_: i64, id: *mut wire_uint_8_list) { - wire_cancel_download_impl(port_, id) -} - -// Section: allocate functions - -#[no_mangle] -pub extern "C" fn new_uint_8_list_0(len: i32) -> *mut wire_uint_8_list { - let ans = wire_uint_8_list { - ptr: support::new_leak_vec_ptr(Default::default(), len), - len, - }; - support::new_leak_box_ptr(ans) -} - -// Section: related functions - -// Section: impl Wire2Api - -impl Wire2Api for *mut wire_uint_8_list { - fn wire2api(self) -> String { - let vec: Vec = self.wire2api(); - String::from_utf8_lossy(&vec).into_owned() - } -} - -impl Wire2Api> for *mut wire_uint_8_list { - fn wire2api(self) -> Vec { - unsafe { - let wrap = support::box_from_leak_ptr(self); - support::vec_from_leak_ptr(wrap.ptr, wrap.len) - } - } -} -// Section: wire structs - -#[repr(C)] -#[derive(Clone)] -pub struct wire_uint_8_list { - ptr: *mut u8, - len: i32, -} - -// Section: impl NewWithNullPtr - -pub trait NewWithNullPtr { - fn new_with_null_ptr() -> Self; -} - -impl NewWithNullPtr for *mut T { - fn new_with_null_ptr() -> Self { - std::ptr::null_mut() - } -} - -// Section: sync execution mode utility - -#[no_mangle] -pub extern "C" fn free_WireSyncReturn(ptr: support::WireSyncReturn) { - unsafe { - let _ = support::box_from_leak_ptr(ptr); - }; -} diff --git a/rust/src/bridge_generated.rs b/rust/src/bridge_generated.rs deleted file mode 100644 index 824fde1..0000000 --- a/rust/src/bridge_generated.rs +++ /dev/null @@ -1,179 +0,0 @@ -#![allow( - non_camel_case_types, - unused, - clippy::redundant_closure, - clippy::useless_conversion, - clippy::unit_arg, - clippy::double_parens, - non_snake_case, - clippy::too_many_arguments -)] -// AUTO GENERATED FILE, DO NOT EDIT. -// Generated by `flutter_rust_bridge`@ 1.82.3. - -use crate::api::*; -use core::panic::UnwindSafe; -use flutter_rust_bridge::rust2dart::IntoIntoDart; -use flutter_rust_bridge::*; -use std::ffi::c_void; -use std::sync::Arc; - -// Section: imports - -use crate::downloader::DownloadCallbackData; -use crate::downloader::MyDownloaderStatus; -use crate::downloader::MyNetworkItemPendingType; - -// Section: wire functions - -fn wire_ping_impl(port_: MessagePort) { - FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, String, _>( - WrapInfo { - debug_name: "ping", - port: Some(port_), - mode: FfiCallMode::Normal, - }, - move || move |task_callback| Result::<_, ()>::Ok(ping()), - ) -} -fn wire_start_download_impl( - port_: MessagePort, - url: impl Wire2Api + UnwindSafe, - save_path: impl Wire2Api + UnwindSafe, - file_name: impl Wire2Api + UnwindSafe, - connection_count: impl Wire2Api + UnwindSafe, -) { - FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, (), _>( - WrapInfo { - debug_name: "start_download", - port: Some(port_), - mode: FfiCallMode::Stream, - }, - move || { - let api_url = url.wire2api(); - let api_save_path = save_path.wire2api(); - let api_file_name = file_name.wire2api(); - let api_connection_count = connection_count.wire2api(); - move |task_callback| { - Result::<_, ()>::Ok(start_download( - api_url, - api_save_path, - api_file_name, - api_connection_count, - task_callback.stream_sink::<_, DownloadCallbackData>(), - )) - } - }, - ) -} -fn wire_cancel_download_impl(port_: MessagePort, id: impl Wire2Api + UnwindSafe) { - FLUTTER_RUST_BRIDGE_HANDLER.wrap::<_, _, _, (), _>( - WrapInfo { - debug_name: "cancel_download", - port: Some(port_), - mode: FfiCallMode::Normal, - }, - move || { - let api_id = id.wire2api(); - move |task_callback| Result::<_, ()>::Ok(cancel_download(api_id)) - }, - ) -} -// Section: wrapper structs - -// Section: static checks - -// Section: allocate functions - -// Section: related functions - -// Section: impl Wire2Api - -pub trait Wire2Api { - fn wire2api(self) -> T; -} - -impl Wire2Api> for *mut S -where - *mut S: Wire2Api, -{ - fn wire2api(self) -> Option { - (!self.is_null()).then(|| self.wire2api()) - } -} - -impl Wire2Api for u8 { - fn wire2api(self) -> u8 { - self - } -} - -// Section: impl IntoDart - -impl support::IntoDart for DownloadCallbackData { - fn into_dart(self) -> support::DartAbi { - vec![ - self.id.into_into_dart().into_dart(), - self.total.into_into_dart().into_dart(), - self.progress.into_into_dart().into_dart(), - self.speed.into_into_dart().into_dart(), - self.status.into_into_dart().into_dart(), - ] - .into_dart() - } -} -impl support::IntoDartExceptPrimitive for DownloadCallbackData {} -impl rust2dart::IntoIntoDart for DownloadCallbackData { - fn into_into_dart(self) -> Self { - self - } -} - -impl support::IntoDart for MyDownloaderStatus { - fn into_dart(self) -> support::DartAbi { - match self { - Self::NoStart => vec![0.into_dart()], - Self::Running => vec![1.into_dart()], - Self::Pending(field0) => vec![2.into_dart(), field0.into_into_dart().into_dart()], - Self::Error(field0) => vec![3.into_dart(), field0.into_into_dart().into_dart()], - Self::Finished => vec![4.into_dart()], - } - .into_dart() - } -} -impl support::IntoDartExceptPrimitive for MyDownloaderStatus {} -impl rust2dart::IntoIntoDart for MyDownloaderStatus { - fn into_into_dart(self) -> Self { - self - } -} - -impl support::IntoDart for MyNetworkItemPendingType { - fn into_dart(self) -> support::DartAbi { - match self { - Self::QueueUp => 0, - Self::Starting => 1, - Self::Stopping => 2, - Self::Initializing => 3, - } - .into_dart() - } -} -impl support::IntoDartExceptPrimitive for MyNetworkItemPendingType {} -impl rust2dart::IntoIntoDart for MyNetworkItemPendingType { - fn into_into_dart(self) -> Self { - self - } -} - -// Section: executor - -support::lazy_static! { - pub static ref FLUTTER_RUST_BRIDGE_HANDLER: support::DefaultHandler = Default::default(); -} - -#[cfg(not(target_family = "wasm"))] -#[path = "bridge_generated.io.rs"] -mod io; -#[cfg(not(target_family = "wasm"))] -pub use io::*; diff --git a/rust/src/downloader/mod.rs b/rust/src/downloader/mod.rs index fa20465..f603e84 100644 --- a/rust/src/downloader/mod.rs +++ b/rust/src/downloader/mod.rs @@ -5,11 +5,11 @@ use std::path::PathBuf; use std::sync::Arc; use std::time::Duration; use async_std::sync::Mutex; +use flutter_rust_bridge::for_generated::lazy_static; use http_downloader::{breakpoint_resume::DownloadBreakpointResumeExtension, ExtendedHttpFileDownloader, HttpDownloaderBuilder, speed_tracker::DownloadSpeedTrackerExtension, status_tracker::DownloadStatusTrackerExtension}; use http_downloader::bson_file_archiver::{ArchiveFilePath, BsonFileArchiverBuilder}; use url::Url; -use flutter_rust_bridge::StreamSink; -use flutter_rust_bridge::support::lazy_static; +use crate::frb_generated::StreamSink; use http_downloader::status_tracker::{DownloaderStatus, NetworkItemPendingType}; use uuid::Uuid; @@ -107,7 +107,7 @@ pub async fn do_start_download(url: String, save_path: String, file_name: String let total_len = total_size_future.await; if let Some(total_len) = total_len { // info!("Total size: {:.2} Mb",total_len.get() as f64 / 1024_f64/ 1024_f64); - sink_clone.add(DownloadCallbackData::new(id.to_string(), total_len.get())); + sink_clone.add(DownloadCallbackData::new(id.to_string(), total_len.get())).unwrap(); } while downloaded_len_receiver.changed().await.is_ok() { @@ -122,7 +122,7 @@ pub async fn do_start_download(url: String, save_path: String, file_name: String progress: p, speed: _byte_per_second, status: get_my_status(_status), - }); + }).unwrap(); } tokio::time::sleep(Duration::from_millis(100)).await; } @@ -137,8 +137,7 @@ pub async fn do_start_download(url: String, save_path: String, file_name: String progress: 0, speed: 0, status: get_my_status(_status), - }); - sink.close(); + }).unwrap(); remove_downloader(&id.to_string()).await; println!("rust downloader download complete"); Ok(()) diff --git a/rust/src/frb_generated.io.rs b/rust/src/frb_generated.io.rs new file mode 100644 index 0000000..a8a3b15 --- /dev/null +++ b/rust/src/frb_generated.io.rs @@ -0,0 +1,13 @@ +// This file is automatically generated, so please do not edit it. +// Generated by `flutter_rust_bridge`@ 2.0.0-dev.23. + +// Section: imports + +use super::*; +use flutter_rust_bridge::for_generated::byteorder::{NativeEndian, ReadBytesExt, WriteBytesExt}; +use flutter_rust_bridge::for_generated::transform_result_dco; +use flutter_rust_bridge::{Handler, IntoIntoDart}; + +// Section: boilerplate + +flutter_rust_bridge::frb_generated_boilerplate_io!(); diff --git a/rust/src/frb_generated.rs b/rust/src/frb_generated.rs new file mode 100644 index 0000000..0a5da19 --- /dev/null +++ b/rust/src/frb_generated.rs @@ -0,0 +1,459 @@ +// This file is automatically generated, so please do not edit it. +// Generated by `flutter_rust_bridge`@ 2.0.0-dev.23. + +#![allow( + non_camel_case_types, + unused, + non_snake_case, + clippy::needless_return, + clippy::redundant_closure_call, + clippy::redundant_closure, + clippy::useless_conversion, + clippy::unit_arg, + clippy::unused_unit, + clippy::double_parens, + clippy::let_and_return, + clippy::too_many_arguments, + clippy::match_single_binding +)] + +// Section: imports + +use flutter_rust_bridge::for_generated::byteorder::{NativeEndian, ReadBytesExt, WriteBytesExt}; +use flutter_rust_bridge::for_generated::transform_result_dco; +use flutter_rust_bridge::{Handler, IntoIntoDart}; + +// Section: boilerplate + +flutter_rust_bridge::frb_generated_boilerplate!( + default_stream_sink_codec = SseCodec, + default_rust_opaque = RustOpaqueMoi, + default_rust_auto_opaque = RustAutoOpaqueMoi, +); +const FLUTTER_RUST_BRIDGE_CODEGEN_VERSION: &str = "2.0.0-dev.23"; + +// Section: executor + +flutter_rust_bridge::frb_generated_default_handler!(); + +// Section: wire_funcs + +fn wire_cancel_download_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr, + rust_vec_len_: i32, + data_len_: i32, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "cancel_download", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let message = unsafe { + flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire( + ptr_, + rust_vec_len_, + data_len_, + ) + }; + let mut deserializer = + flutter_rust_bridge::for_generated::SseDeserializer::new(message); + let api_id = ::sse_decode(&mut deserializer); + deserializer.end(); + move |context| async move { + transform_result_sse( + (move || async move { + Result::<_, ()>::Ok( + crate::api::downloader_api::cancel_download(api_id).await, + ) + })() + .await, + ) + } + }, + ) +} +fn wire_start_download_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr, + rust_vec_len_: i32, + data_len_: i32, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "start_download", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Stream, + }, + move || { + let message = unsafe { + flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire( + ptr_, + rust_vec_len_, + data_len_, + ) + }; + let mut deserializer = + flutter_rust_bridge::for_generated::SseDeserializer::new(message); + let api_url = ::sse_decode(&mut deserializer); + let api_save_path = ::sse_decode(&mut deserializer); + let api_file_name = ::sse_decode(&mut deserializer); + let api_connection_count = ::sse_decode(&mut deserializer); + deserializer.end(); + move |context| { + transform_result_sse((move || { + Result::<_, ()>::Ok(crate::api::downloader_api::start_download( + api_url, + api_save_path, + api_file_name, + api_connection_count, + StreamSink::new( + context + .rust2dart_context() + .stream_sink::<_, crate::downloader::DownloadCallbackData>(), + ), + )) + })()) + } + }, + ) +} + +// Section: dart2rust + +impl SseDecode for String { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = >::sse_decode(deserializer); + return String::from_utf8(inner).unwrap(); + } +} + +impl SseDecode for crate::downloader::DownloadCallbackData { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut var_id = ::sse_decode(deserializer); + let mut var_total = ::sse_decode(deserializer); + let mut var_progress = ::sse_decode(deserializer); + let mut var_speed = ::sse_decode(deserializer); + let mut var_status = ::sse_decode(deserializer); + return crate::downloader::DownloadCallbackData { + id: var_id, + total: var_total, + progress: var_progress, + speed: var_speed, + status: var_status, + }; + } +} + +impl SseDecode for i32 { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + deserializer.cursor.read_i32::().unwrap() + } +} + +impl SseDecode for Vec { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut len_ = ::sse_decode(deserializer); + let mut ans_ = vec![]; + for idx_ in 0..len_ { + ans_.push(::sse_decode(deserializer)); + } + return ans_; + } +} + +impl SseDecode for crate::downloader::MyDownloaderStatus { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut tag_ = ::sse_decode(deserializer); + match tag_ { + 0 => { + return crate::downloader::MyDownloaderStatus::NoStart; + } + 1 => { + return crate::downloader::MyDownloaderStatus::Running; + } + 2 => { + let mut var_field0 = + ::sse_decode(deserializer); + return crate::downloader::MyDownloaderStatus::Pending(var_field0); + } + 3 => { + let mut var_field0 = ::sse_decode(deserializer); + return crate::downloader::MyDownloaderStatus::Error(var_field0); + } + 4 => { + return crate::downloader::MyDownloaderStatus::Finished; + } + _ => { + unimplemented!(""); + } + } + } +} + +impl SseDecode for crate::downloader::MyNetworkItemPendingType { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut inner = ::sse_decode(deserializer); + return match inner { + 0 => crate::downloader::MyNetworkItemPendingType::QueueUp, + 1 => crate::downloader::MyNetworkItemPendingType::Starting, + 2 => crate::downloader::MyNetworkItemPendingType::Stopping, + 3 => crate::downloader::MyNetworkItemPendingType::Initializing, + _ => unreachable!("Invalid variant for MyNetworkItemPendingType: {}", inner), + }; + } +} + +impl SseDecode for u64 { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + deserializer.cursor.read_u64::().unwrap() + } +} + +impl SseDecode for u8 { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + deserializer.cursor.read_u8().unwrap() + } +} + +impl SseDecode for () { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {} +} + +impl SseDecode for bool { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + deserializer.cursor.read_u8().unwrap() != 0 + } +} + +fn pde_ffi_dispatcher_primary_impl( + func_id: i32, + port: flutter_rust_bridge::for_generated::MessagePort, + ptr: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr, + rust_vec_len: i32, + data_len: i32, +) { + // Codec=Pde (Serialization + dispatch), see doc to use other codecs + match func_id { + 2 => wire_cancel_download_impl(port, ptr, rust_vec_len, data_len), + 1 => wire_start_download_impl(port, ptr, rust_vec_len, data_len), + _ => unreachable!(), + } +} + +fn pde_ffi_dispatcher_sync_impl( + func_id: i32, + ptr: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr, + rust_vec_len: i32, + data_len: i32, +) -> flutter_rust_bridge::for_generated::WireSyncRust2DartSse { + // Codec=Pde (Serialization + dispatch), see doc to use other codecs + match func_id { + _ => unreachable!(), + } +} + +// Section: rust2dart + +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::downloader::DownloadCallbackData { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [ + self.id.into_into_dart().into_dart(), + self.total.into_into_dart().into_dart(), + self.progress.into_into_dart().into_dart(), + self.speed.into_into_dart().into_dart(), + self.status.into_into_dart().into_dart(), + ] + .into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::downloader::DownloadCallbackData +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::downloader::DownloadCallbackData +{ + fn into_into_dart(self) -> crate::downloader::DownloadCallbackData { + self + } +} +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::downloader::MyDownloaderStatus { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + match self { + crate::downloader::MyDownloaderStatus::NoStart => [0.into_dart()].into_dart(), + crate::downloader::MyDownloaderStatus::Running => [1.into_dart()].into_dart(), + crate::downloader::MyDownloaderStatus::Pending(field0) => { + [2.into_dart(), field0.into_into_dart().into_dart()].into_dart() + } + crate::downloader::MyDownloaderStatus::Error(field0) => { + [3.into_dart(), field0.into_into_dart().into_dart()].into_dart() + } + crate::downloader::MyDownloaderStatus::Finished => [4.into_dart()].into_dart(), + } + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::downloader::MyDownloaderStatus +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::downloader::MyDownloaderStatus +{ + fn into_into_dart(self) -> crate::downloader::MyDownloaderStatus { + self + } +} +// Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::downloader::MyNetworkItemPendingType { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + match self { + Self::QueueUp => 0.into_dart(), + Self::Starting => 1.into_dart(), + Self::Stopping => 2.into_dart(), + Self::Initializing => 3.into_dart(), + } + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::downloader::MyNetworkItemPendingType +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::downloader::MyNetworkItemPendingType +{ + fn into_into_dart(self) -> crate::downloader::MyNetworkItemPendingType { + self + } +} + +impl SseEncode for String { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + >::sse_encode(self.into_bytes(), serializer); + } +} + +impl SseEncode for crate::downloader::DownloadCallbackData { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + ::sse_encode(self.id, serializer); + ::sse_encode(self.total, serializer); + ::sse_encode(self.progress, serializer); + ::sse_encode(self.speed, serializer); + ::sse_encode(self.status, serializer); + } +} + +impl SseEncode for i32 { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + serializer.cursor.write_i32::(self).unwrap(); + } +} + +impl SseEncode for Vec { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + ::sse_encode(self.len() as _, serializer); + for item in self { + ::sse_encode(item, serializer); + } + } +} + +impl SseEncode for crate::downloader::MyDownloaderStatus { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + match self { + crate::downloader::MyDownloaderStatus::NoStart => { + ::sse_encode(0, serializer); + } + crate::downloader::MyDownloaderStatus::Running => { + ::sse_encode(1, serializer); + } + crate::downloader::MyDownloaderStatus::Pending(field0) => { + ::sse_encode(2, serializer); + ::sse_encode(field0, serializer); + } + crate::downloader::MyDownloaderStatus::Error(field0) => { + ::sse_encode(3, serializer); + ::sse_encode(field0, serializer); + } + crate::downloader::MyDownloaderStatus::Finished => { + ::sse_encode(4, serializer); + } + } + } +} + +impl SseEncode for crate::downloader::MyNetworkItemPendingType { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + ::sse_encode( + match self { + crate::downloader::MyNetworkItemPendingType::QueueUp => 0, + crate::downloader::MyNetworkItemPendingType::Starting => 1, + crate::downloader::MyNetworkItemPendingType::Stopping => 2, + crate::downloader::MyNetworkItemPendingType::Initializing => 3, + _ => { + unimplemented!(""); + } + }, + serializer, + ); + } +} + +impl SseEncode for u64 { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + serializer.cursor.write_u64::(self).unwrap(); + } +} + +impl SseEncode for u8 { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + serializer.cursor.write_u8(self).unwrap(); + } +} + +impl SseEncode for () { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {} +} + +impl SseEncode for bool { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + serializer.cursor.write_u8(self as _).unwrap(); + } +} + +#[cfg(not(target_family = "wasm"))] +#[path = "frb_generated.io.rs"] +mod io; +#[cfg(not(target_family = "wasm"))] +pub use io::*; + +/// cbindgen:ignore +#[cfg(target_family = "wasm")] +#[path = "frb_generated.web.rs"] +mod web; +#[cfg(target_family = "wasm")] +pub use web::*; diff --git a/rust/src/frb_generated.web.rs b/rust/src/frb_generated.web.rs new file mode 100644 index 0000000..9ab62ad --- /dev/null +++ b/rust/src/frb_generated.web.rs @@ -0,0 +1,15 @@ +// This file is automatically generated, so please do not edit it. +// Generated by `flutter_rust_bridge`@ 2.0.0-dev.23. + +// Section: imports + +use super::*; +use flutter_rust_bridge::for_generated::byteorder::{NativeEndian, ReadBytesExt, WriteBytesExt}; +use flutter_rust_bridge::for_generated::transform_result_dco; +use flutter_rust_bridge::for_generated::wasm_bindgen; +use flutter_rust_bridge::for_generated::wasm_bindgen::prelude::*; +use flutter_rust_bridge::{Handler, IntoIntoDart}; + +// Section: boilerplate + +flutter_rust_bridge::frb_generated_boilerplate_web!(); diff --git a/rust/src/lib.rs b/rust/src/lib.rs index 49c0daa..a465255 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -1,3 +1,3 @@ +mod frb_generated; mod api; -mod bridge_generated; mod downloader; diff --git a/update_rsut.bat b/update_rsut.bat index 9bf3f64..ef96997 100644 --- a/update_rsut.bat +++ b/update_rsut.bat @@ -1,2 +1 @@ -flutter_rust_bridge_codegen --rust-input rust\src\api.rs --dart-output .\lib\common\rust\bridge_generated.dart --dart-decl-output .\lib\common\rust\bridge_definitions.dart -dart run build_runner build \ No newline at end of file +flutter_rust_bridge_codegen generate \ No newline at end of file diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index 373d104..aa2c913 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -12,6 +12,7 @@ list(APPEND FLUTTER_PLUGIN_LIST ) list(APPEND FLUTTER_FFI_PLUGIN_LIST + rust_builder ) set(PLUGIN_BUNDLED_LIBRARIES)