diff --git a/lib/bloc/main_bloc.dart b/lib/bloc/main_bloc.dart index 094316b..99d1ffd 100644 --- a/lib/bloc/main_bloc.dart +++ b/lib/bloc/main_bloc.dart @@ -189,7 +189,7 @@ class MainBloc extends Bloc { final id = await client.registerDevice( RegisterDeviceRequest( deviceInfo: DeviceInfo( - deviceModel: _deviceInfo.deviceModel, + deviceName: _deviceInfo.deviceName, systemVersion: _deviceInfo.systemVersion, clientName: _packageInfo.appName, clientSourceCodeAddress: clientSourceCodeUrl, diff --git a/lib/model/common_model.dart b/lib/model/common_model.dart index 93ed850..c2d233b 100644 --- a/lib/model/common_model.dart +++ b/lib/model/common_model.dart @@ -39,7 +39,7 @@ class ClientCommonData with _$ClientCommonData { @freezed class ClientDeviceInfo with _$ClientDeviceInfo { const factory ClientDeviceInfo( - String deviceModel, + String deviceName, String systemVersion, ) = _ClientDeviceInfo; diff --git a/lib/model/common_model.freezed.dart b/lib/model/common_model.freezed.dart index 5a3c7cd..309e392 100644 --- a/lib/model/common_model.freezed.dart +++ b/lib/model/common_model.freezed.dart @@ -490,7 +490,7 @@ ClientDeviceInfo _$ClientDeviceInfoFromJson(Map json) { /// @nodoc mixin _$ClientDeviceInfo { - String get deviceModel => throw _privateConstructorUsedError; + String get deviceName => throw _privateConstructorUsedError; String get systemVersion => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; @@ -505,7 +505,7 @@ abstract class $ClientDeviceInfoCopyWith<$Res> { ClientDeviceInfo value, $Res Function(ClientDeviceInfo) then) = _$ClientDeviceInfoCopyWithImpl<$Res, ClientDeviceInfo>; @useResult - $Res call({String deviceModel, String systemVersion}); + $Res call({String deviceName, String systemVersion}); } /// @nodoc @@ -521,13 +521,13 @@ class _$ClientDeviceInfoCopyWithImpl<$Res, $Val extends ClientDeviceInfo> @pragma('vm:prefer-inline') @override $Res call({ - Object? deviceModel = null, + Object? deviceName = null, Object? systemVersion = null, }) { return _then(_value.copyWith( - deviceModel: null == deviceModel - ? _value.deviceModel - : deviceModel // ignore: cast_nullable_to_non_nullable + deviceName: null == deviceName + ? _value.deviceName + : deviceName // ignore: cast_nullable_to_non_nullable as String, systemVersion: null == systemVersion ? _value.systemVersion @@ -545,7 +545,7 @@ abstract class _$$ClientDeviceInfoImplCopyWith<$Res> __$$ClientDeviceInfoImplCopyWithImpl<$Res>; @override @useResult - $Res call({String deviceModel, String systemVersion}); + $Res call({String deviceName, String systemVersion}); } /// @nodoc @@ -559,13 +559,13 @@ class __$$ClientDeviceInfoImplCopyWithImpl<$Res> @pragma('vm:prefer-inline') @override $Res call({ - Object? deviceModel = null, + Object? deviceName = null, Object? systemVersion = null, }) { return _then(_$ClientDeviceInfoImpl( - null == deviceModel - ? _value.deviceModel - : deviceModel // ignore: cast_nullable_to_non_nullable + null == deviceName + ? _value.deviceName + : deviceName // ignore: cast_nullable_to_non_nullable as String, null == systemVersion ? _value.systemVersion @@ -578,19 +578,19 @@ class __$$ClientDeviceInfoImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() class _$ClientDeviceInfoImpl implements _ClientDeviceInfo { - const _$ClientDeviceInfoImpl(this.deviceModel, this.systemVersion); + const _$ClientDeviceInfoImpl(this.deviceName, this.systemVersion); factory _$ClientDeviceInfoImpl.fromJson(Map json) => _$$ClientDeviceInfoImplFromJson(json); @override - final String deviceModel; + final String deviceName; @override final String systemVersion; @override String toString() { - return 'ClientDeviceInfo(deviceModel: $deviceModel, systemVersion: $systemVersion)'; + return 'ClientDeviceInfo(deviceName: $deviceName, systemVersion: $systemVersion)'; } @override @@ -598,15 +598,15 @@ class _$ClientDeviceInfoImpl implements _ClientDeviceInfo { return identical(this, other) || (other.runtimeType == runtimeType && other is _$ClientDeviceInfoImpl && - (identical(other.deviceModel, deviceModel) || - other.deviceModel == deviceModel) && + (identical(other.deviceName, deviceName) || + other.deviceName == deviceName) && (identical(other.systemVersion, systemVersion) || other.systemVersion == systemVersion)); } @JsonKey(ignore: true) @override - int get hashCode => Object.hash(runtimeType, deviceModel, systemVersion); + int get hashCode => Object.hash(runtimeType, deviceName, systemVersion); @JsonKey(ignore: true) @override @@ -625,14 +625,14 @@ class _$ClientDeviceInfoImpl implements _ClientDeviceInfo { abstract class _ClientDeviceInfo implements ClientDeviceInfo { const factory _ClientDeviceInfo( - final String deviceModel, final String systemVersion) = + final String deviceName, final String systemVersion) = _$ClientDeviceInfoImpl; factory _ClientDeviceInfo.fromJson(Map json) = _$ClientDeviceInfoImpl.fromJson; @override - String get deviceModel; + String get deviceName; @override String get systemVersion; @override diff --git a/lib/model/common_model.g.dart b/lib/model/common_model.g.dart index 87d8e18..2129c80 100644 --- a/lib/model/common_model.g.dart +++ b/lib/model/common_model.g.dart @@ -51,13 +51,13 @@ Map _$$ClientCommonDataImplToJson( _$ClientDeviceInfoImpl _$$ClientDeviceInfoImplFromJson( Map json) => _$ClientDeviceInfoImpl( - json['deviceModel'] as String, + json['deviceName'] as String, json['systemVersion'] as String, ); Map _$$ClientDeviceInfoImplToJson( _$ClientDeviceInfoImpl instance) => { - 'deviceModel': instance.deviceModel, + 'deviceName': instance.deviceName, 'systemVersion': instance.systemVersion, }; diff --git a/lib/view/pages/server_select_overlay.dart b/lib/view/pages/server_select_overlay.dart index 44d27d6..cbbfba7 100644 --- a/lib/view/pages/server_select_overlay.dart +++ b/lib/view/pages/server_select_overlay.dart @@ -134,7 +134,7 @@ class ServerSelectOverlayState extends State decoration: BoxDecoration( image: DecorationImage( image: ExtendedNetworkImageProvider( - 'https://dl.mosarin.tech/api/raw/?path=/Images/road.jpg'), + ''), fit: BoxFit.cover, ), ), diff --git a/lib/view/pages/settings/session/session_edit_page.dart b/lib/view/pages/settings/session/session_edit_page.dart index c6270ad..e1f8a8e 100644 --- a/lib/view/pages/settings/session/session_edit_page.dart +++ b/lib/view/pages/settings/session/session_edit_page.dart @@ -63,7 +63,7 @@ class SessionEditPage extends StatelessWidget { height: 16, ), TextFormField( - initialValue: '${session.deviceInfo.deviceModel} ', + initialValue: '${session.deviceInfo.deviceName} ', readOnly: true, decoration: const InputDecoration( border: OutlineInputBorder(), diff --git a/lib/view/pages/settings/session/session_manage_page.dart b/lib/view/pages/settings/session/session_manage_page.dart index 29f92ba..5a2cc91 100644 --- a/lib/view/pages/settings/session/session_manage_page.dart +++ b/lib/view/pages/settings/session/session_manage_page.dart @@ -72,10 +72,10 @@ class SessionManagePage extends StatelessWidget { maxLines: 2, ), Text( - deviceInfo.deviceModel.isNotEmpty || + deviceInfo.deviceName.isNotEmpty || deviceInfo .systemVersion.isNotEmpty - ? '${deviceInfo.deviceModel} ${deviceInfo.systemVersion}' + ? '${deviceInfo.deviceName} ${deviceInfo.systemVersion}' : '未知设备', ), ], @@ -137,13 +137,13 @@ class SessionManagePage extends StatelessWidget { maxLines: 2, ), Text( - item.deviceInfo.deviceModel + item.deviceInfo.deviceName .isNotEmpty || item .deviceInfo .systemVersion .isNotEmpty - ? '${item.deviceInfo.deviceModel} ${item.deviceInfo.systemVersion}' + ? '${item.deviceInfo.deviceName} ${item.deviceInfo.systemVersion}' : '未知设备', ), Text( diff --git a/pubspec.yaml b/pubspec.yaml index 6768c7a..2189e73 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -54,7 +54,7 @@ dependencies: tuihub_protos: git: url: https://github.com/tuihub/protos.git - ref: v0.3.8 + ref: v0.3.9 fixnum: ^1.1.0 # theme