add detail page
This commit is contained in:
@@ -6,7 +6,7 @@ class FilamentModel {
|
||||
final double weight;
|
||||
final double weightUsed;
|
||||
final double price;
|
||||
final String manufacture;
|
||||
final String manufacturer;
|
||||
final String purchaseDate;
|
||||
final String? notes;
|
||||
final int printingTemp;
|
||||
@@ -20,7 +20,7 @@ class FilamentModel {
|
||||
required this.weight,
|
||||
required this.weightUsed,
|
||||
required this.price,
|
||||
required this.manufacture,
|
||||
required this.manufacturer,
|
||||
required this.purchaseDate,
|
||||
this.notes,
|
||||
required this.printingTemp,
|
||||
@@ -29,18 +29,18 @@ class FilamentModel {
|
||||
|
||||
static FilamentModel fromJson(Map<String, dynamic> json) {
|
||||
return FilamentModel(
|
||||
documentId: json['\$id'],
|
||||
name: json['name'],
|
||||
type: json['type'],
|
||||
color: json['color'],
|
||||
weight: (json['weight'] as num).toDouble(),
|
||||
weightUsed: (json['weightUsed'] as num).toDouble(),
|
||||
price: (json['price'] as num).toDouble(),
|
||||
manufacture: json['manufacture'],
|
||||
purchaseDate: json['purchaseDate'],
|
||||
documentId: json['\$id'] as String? ?? '',
|
||||
name: json['name'] as String? ?? '',
|
||||
type: json['type'] as String? ?? '',
|
||||
color: json['color'] as String? ?? '',
|
||||
weight: (json['weight'] as num?)?.toDouble() ?? 0.0,
|
||||
weightUsed: (json['weightUsed'] as num?)?.toDouble() ?? 0.0,
|
||||
price: (json['price'] as num?)?.toDouble() ?? 0.0,
|
||||
manufacturer: json['manufacturer'] as String? ?? '',
|
||||
purchaseDate: json['purchaseDate'] as String? ?? '',
|
||||
notes: json['notes'] as String?,
|
||||
printingTemp: json['printingTemp'],
|
||||
bedTemp: json['bedTemp'],
|
||||
printingTemp: (json['printingTemp'] as num?)?.toInt() ?? 0,
|
||||
bedTemp: (json['bedTemp'] as num?)?.toInt() ?? 0,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ class FilamentModel {
|
||||
'weight': filamentModel.weight,
|
||||
'weightUsed': filamentModel.weightUsed,
|
||||
'price': filamentModel.price,
|
||||
'manufacture': filamentModel.manufacture,
|
||||
'manufacturer': filamentModel.manufacturer,
|
||||
'purchaseDate': filamentModel.purchaseDate,
|
||||
if (filamentModel.notes != null) 'notes': filamentModel.notes,
|
||||
'printingTemp': filamentModel.printingTemp,
|
||||
@@ -69,7 +69,7 @@ class FilamentModel {
|
||||
weight: 0.0,
|
||||
weightUsed: 0.0,
|
||||
price: 0.0,
|
||||
manufacture: '',
|
||||
manufacturer: '',
|
||||
purchaseDate: '',
|
||||
notes: null,
|
||||
printingTemp: 0,
|
||||
|
||||
Reference in New Issue
Block a user