mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-30 23:58:13 +08:00
refa: article (#757)
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
32
lib/models/dynamics/opus_detail/layer.dart
Normal file
32
lib/models/dynamics/opus_detail/layer.dart
Normal file
@@ -0,0 +1,32 @@
|
||||
import 'general_spec.dart';
|
||||
import 'layer_config.dart';
|
||||
import 'resource.dart';
|
||||
|
||||
class Layer {
|
||||
GeneralSpec? generalSpec;
|
||||
LayerConfig? layerConfig;
|
||||
Resource? resource;
|
||||
bool? visible;
|
||||
|
||||
Layer({this.generalSpec, this.layerConfig, this.resource, this.visible});
|
||||
|
||||
factory Layer.fromJson(Map<String, dynamic> json) => Layer(
|
||||
generalSpec: json['general_spec'] == null
|
||||
? null
|
||||
: GeneralSpec.fromJson(json['general_spec'] as Map<String, dynamic>),
|
||||
layerConfig: json['layer_config'] == null
|
||||
? null
|
||||
: LayerConfig.fromJson(json['layer_config'] as Map<String, dynamic>),
|
||||
resource: json['resource'] == null
|
||||
? null
|
||||
: Resource.fromJson(json['resource'] as Map<String, dynamic>),
|
||||
visible: json['visible'] as bool?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'general_spec': generalSpec?.toJson(),
|
||||
'layer_config': layerConfig?.toJson(),
|
||||
'resource': resource?.toJson(),
|
||||
'visible': visible,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user