Skip to content

Commit

Permalink
feat: upgrade proto to v0.3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
MuZhou233 committed Feb 14, 2024
1 parent b464c16 commit 193173b
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion lib/bloc/main_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class MainBloc extends Bloc<MainEvent, MainState> {
final id = await client.registerDevice(
RegisterDeviceRequest(
deviceInfo: DeviceInfo(
deviceModel: _deviceInfo.deviceModel,
deviceName: _deviceInfo.deviceName,
systemVersion: _deviceInfo.systemVersion,
clientName: _packageInfo.appName,
clientSourceCodeAddress: clientSourceCodeUrl,
Expand Down
2 changes: 1 addition & 1 deletion lib/model/common_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class ClientCommonData with _$ClientCommonData {
@freezed
class ClientDeviceInfo with _$ClientDeviceInfo {
const factory ClientDeviceInfo(
String deviceModel,
String deviceName,
String systemVersion,
) = _ClientDeviceInfo;

Expand Down
38 changes: 19 additions & 19 deletions lib/model/common_model.freezed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ ClientDeviceInfo _$ClientDeviceInfoFromJson(Map<String, dynamic> json) {

/// @nodoc
mixin _$ClientDeviceInfo {
String get deviceModel => throw _privateConstructorUsedError;
String get deviceName => throw _privateConstructorUsedError;
String get systemVersion => throw _privateConstructorUsedError;

Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -578,35 +578,35 @@ 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<String, dynamic> 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
bool operator ==(Object other) {
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
Expand All @@ -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<String, dynamic> json) =
_$ClientDeviceInfoImpl.fromJson;

@override
String get deviceModel;
String get deviceName;
@override
String get systemVersion;
@override
Expand Down
4 changes: 2 additions & 2 deletions lib/model/common_model.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/view/pages/server_select_overlay.dart
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class ServerSelectOverlayState extends State<ServerSelectOverlay>
decoration: BoxDecoration(
image: DecorationImage(
image: ExtendedNetworkImageProvider(
'https://dl.mosarin.tech/api/raw/?path=/Images/road.jpg'),
''),
fit: BoxFit.cover,
),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/view/pages/settings/session/session_edit_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
8 changes: 4 additions & 4 deletions lib/view/pages/settings/session/session_manage_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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}'
: '未知设备',
),
],
Expand Down Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 193173b

Please sign in to comment.