first commit
This commit is contained in:
46
lib/model/printer_device.dart
Normal file
46
lib/model/printer_device.dart
Normal file
@@ -0,0 +1,46 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
class PrinterDev extends Equatable {
|
||||
int id;
|
||||
String deviceName;
|
||||
String? address;
|
||||
String? port;
|
||||
String? vendorId;
|
||||
String? productId;
|
||||
bool? isBle;
|
||||
|
||||
bool? state;
|
||||
|
||||
PrinterDev(
|
||||
{required this.deviceName,
|
||||
required this.id,
|
||||
this.address,
|
||||
this.port,
|
||||
this.state = true,
|
||||
this.vendorId,
|
||||
this.productId,
|
||||
this.isBle = false});
|
||||
|
||||
PrinterDev.fromJson(Map<String, dynamic> json)
|
||||
: deviceName = json['deviceName'],
|
||||
id = json['id'],
|
||||
address = json['address'],
|
||||
port = json['port'],
|
||||
state = json['state'],
|
||||
vendorId = json['vendorId'],
|
||||
productId = json['productId'],
|
||||
isBle = json['this.isBle'];
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'deviceName': deviceName,
|
||||
'address': address,
|
||||
'port': port,
|
||||
'state': state,
|
||||
'vendorId': vendorId,
|
||||
'productId': productId,
|
||||
'isBle': isBle,
|
||||
'id': id
|
||||
};
|
||||
@override
|
||||
List<Object?> get props => [deviceName];
|
||||
}
|
||||
Reference in New Issue
Block a user