mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
opt.: use json_serializable
This commit is contained in:
@@ -51,3 +51,26 @@ class ServerCustomAdapter extends TypeAdapter<ServerCustom> {
|
||||
runtimeType == other.runtimeType &&
|
||||
typeId == other.typeId;
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
ServerCustom _$ServerCustomFromJson(Map<String, dynamic> json) => ServerCustom(
|
||||
pveAddr: json['pveAddr'] as String?,
|
||||
pveIgnoreCert: json['pveIgnoreCert'] as bool? ?? false,
|
||||
cmds: (json['cmds'] as Map<String, dynamic>?)?.map(
|
||||
(k, e) => MapEntry(k, e as String),
|
||||
),
|
||||
preferTempDev: json['preferTempDev'] as String?,
|
||||
logoUrl: json['logoUrl'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ServerCustomToJson(ServerCustom instance) =>
|
||||
<String, dynamic>{
|
||||
'pveAddr': instance.pveAddr,
|
||||
'pveIgnoreCert': instance.pveIgnoreCert,
|
||||
'cmds': instance.cmds,
|
||||
'preferTempDev': instance.preferTempDev,
|
||||
'logoUrl': instance.logoUrl,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user