Model class abstract

Available extensions
Annotations
  • @freezed

Constructors

Model({required String id, required String name, String? flespiId, InboundProtocol? protocol, String? protocolId, bool? isGeneric, @Default.new([]) List<CommandDefinition> commandsStructure, @Default.new([]) List<ConfigGrouping> configStructure, @Default.new(false) bool confiotCapable, @JsonKey.new(unknownEnumValue: ConfIoTLayout.standard) @Default.new(ConfIoTLayout.standard) ConfIoTLayout confiotLayout, String? confiotName, String? peripheralIdentifier, Map<String, dynamic>? peripheralParserSpec, @Default.new([]) List<FirmwareBuild> firmwares})
Model is the model of a device. It contains the information about the model of the device. Does not contain information of connectivity or related, only the model information like the name, the protocol and if is generic or not.
const
factory
Model.fromJson(Map<String, dynamic> json)
factory

Properties

commandsStructure List<CommandDefinition>
commandsStructure is the structure of the commands for the protocol.
no setterinherited
configStructure List<ConfigGrouping>
configStructure is the structure of the configuration for the protocol.
no setterinherited
confiotCapable bool
confiotCapable is the boolean that indicates if the protocol is capable of using the Confiot platform.
no setterinherited
confiotLayout ConfIoTLayout
confiotLayout defines what kind of layout should be displayed in ConfIoT.
no setterinherited
confiotName String?
confiotName is the name of the model in the ConfIoT.
no setterinherited
copyWith → $ModelCopyWith<Model>
Create a copy of Model with the given fields replaced by the non-null parameter values.
no setterinherited
firmwares List<FirmwareBuild>
firmwares is the list of firmwares for the model.
no setterinherited
flespiId String?
flespiId is the ID of the device in the flespi platform. Can be null if the model is not connected to a device or is a in-house protocol.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
id String
id is the unique identifier of the model.
no setterinherited
isGeneric bool?
isGeneric is true if the model is generic.
no setterinherited
name String
name is the name of the model.
no setterinherited
peripheralIdentifier String?
peripheralIdentifier is the identifier of the peripheral device.
no setterinherited
peripheralParserSpec Map<String, dynamic>?
peripheralParserSpec is the parser specification for the peripheral device.
no setterinherited
protocol InboundProtocol?
protocol is the protocol of the model.
no setterinherited
protocolId String?
protocolId is the ID of the protocol
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

map<TResult extends Object?>(TResult $default(_Model value)) → TResult

Available on Model, provided by the ModelPatterns extension

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>(TResult? $default(_Model value)?) → TResult?

Available on Model, provided by the ModelPatterns extension

A variant of map that fallback to returning null.
maybeMap<TResult extends Object?>(TResult $default(_Model value)?, {required TResult orElse()}) → TResult

Available on Model, provided by the ModelPatterns extension

A variant of map that fallback to returning orElse.
maybeWhen<TResult extends Object?>(TResult $default(String id, String name, String? flespiId, InboundProtocol? protocol, String? protocolId, bool? isGeneric, List<CommandDefinition> commandsStructure, List<ConfigGrouping> configStructure, bool confiotCapable, ConfIoTLayout confiotLayout, String? confiotName, String? peripheralIdentifier, Map<String, dynamic>? peripheralParserSpec, List<FirmwareBuild> firmwares)?, {required TResult orElse()}) → TResult

Available on Model, provided by the ModelPatterns extension

A variant of when that fallback to an orElse callback.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Serializes this Model to a JSON map.
inherited
toString() String
A string representation of this object.
inherited
when<TResult extends Object?>(TResult $default(String id, String name, String? flespiId, InboundProtocol? protocol, String? protocolId, bool? isGeneric, List<CommandDefinition> commandsStructure, List<ConfigGrouping> configStructure, bool confiotCapable, ConfIoTLayout confiotLayout, String? confiotName, String? peripheralIdentifier, Map<String, dynamic>? peripheralParserSpec, List<FirmwareBuild> firmwares)) → TResult

Available on Model, provided by the ModelPatterns extension

A switch-like method, using callbacks.
whenOrNull<TResult extends Object?>(TResult? $default(String id, String name, String? flespiId, InboundProtocol? protocol, String? protocolId, bool? isGeneric, List<CommandDefinition> commandsStructure, List<ConfigGrouping> configStructure, bool confiotCapable, ConfIoTLayout confiotLayout, String? confiotName, String? peripheralIdentifier, Map<String, dynamic>? peripheralParserSpec, List<FirmwareBuild> firmwares)?) → TResult?

Available on Model, provided by the ModelPatterns extension

A variant of when that fallback to returning null

Operators

operator ==(Object other) bool
The equality operator.
inherited