Files
ticket-booth-cpone/lib/model/printer_device.dart
2025-01-31 10:12:08 +07:00

47 lines
1.0 KiB
Dart

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];
}