mockup and List View in a Modern Design
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
class FilamentModel {
|
||||
final String id;
|
||||
@@ -8,8 +8,11 @@ class FilamentModel {
|
||||
final double weight; // in Gramm
|
||||
final double price; // Preis
|
||||
final String? manufacturer;
|
||||
final DateTime? purchaseDate;
|
||||
final String? purchaseDate;
|
||||
final String? notes;
|
||||
final int? pices;
|
||||
final int? printingTemp;
|
||||
final int? bedTemp;
|
||||
|
||||
FilamentModel({
|
||||
required this.id,
|
||||
@@ -21,6 +24,9 @@ class FilamentModel {
|
||||
this.manufacturer,
|
||||
this.purchaseDate,
|
||||
this.notes,
|
||||
this.pices,
|
||||
this.printingTemp,
|
||||
this.bedTemp,
|
||||
});
|
||||
|
||||
// JSON Serialisierung
|
||||
@@ -33,8 +39,11 @@ class FilamentModel {
|
||||
'weight': weight,
|
||||
'price': price,
|
||||
'manufacturer': manufacturer,
|
||||
'purchaseDate': purchaseDate?.toIso8601String(),
|
||||
'purchaseDate': purchaseDate,
|
||||
'notes': notes,
|
||||
'pices': pices,
|
||||
'printingTemp': printingTemp,
|
||||
'bedTemp': bedTemp,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -48,10 +57,11 @@ class FilamentModel {
|
||||
weight: (json['weight'] as num).toDouble(),
|
||||
price: (json['price'] as num).toDouble(),
|
||||
manufacturer: json['manufacturer'] as String?,
|
||||
purchaseDate: json['purchaseDate'] != null
|
||||
? DateTime.parse(json['purchaseDate'] as String)
|
||||
: null,
|
||||
purchaseDate: json['purchaseDate'] as String?,
|
||||
notes: json['notes'] as String?,
|
||||
pices: json['pices'] as int?,
|
||||
printingTemp: json['printingTemp'] as int?,
|
||||
bedTemp: json['bedTemp'] as int?,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -64,8 +74,11 @@ class FilamentModel {
|
||||
double? weight,
|
||||
double? price,
|
||||
String? manufacturer,
|
||||
DateTime? purchaseDate,
|
||||
String? purchaseDate,
|
||||
String? notes,
|
||||
int? pices,
|
||||
int? printingTemp,
|
||||
int? bedTemp,
|
||||
}) {
|
||||
return FilamentModel(
|
||||
id: id ?? this.id,
|
||||
@@ -77,6 +90,59 @@ class FilamentModel {
|
||||
manufacturer: manufacturer ?? this.manufacturer,
|
||||
purchaseDate: purchaseDate ?? this.purchaseDate,
|
||||
notes: notes ?? this.notes,
|
||||
pices: pices ?? this.pices,
|
||||
printingTemp: printingTemp ?? this.printingTemp,
|
||||
bedTemp: bedTemp ?? this.bedTemp,
|
||||
);
|
||||
}
|
||||
|
||||
static String formatDate(DateTime date) {
|
||||
final DateFormat formatter = DateFormat('dd.MM.yyyy');
|
||||
return formatter.format(date);
|
||||
}
|
||||
|
||||
static List<FilamentModel> mockupFilamentList = [
|
||||
FilamentModel(
|
||||
id: '1',
|
||||
name: '3Djake ECO Filament',
|
||||
type: 'PLA',
|
||||
color: 'White',
|
||||
weight: 1000.0,
|
||||
price: 19.99,
|
||||
manufacturer: '3Djake.at',
|
||||
purchaseDate: formatDate(DateTime(2026, 1, 10)),
|
||||
notes: 'Great quality filament for everyday printing.',
|
||||
pices: 1,
|
||||
printingTemp: 207,
|
||||
bedTemp: 55,
|
||||
),
|
||||
FilamentModel(
|
||||
id: '2',
|
||||
name: 'Geeetech',
|
||||
type: 'PETG',
|
||||
color: 'Black',
|
||||
weight: 1000.0,
|
||||
price: 9.99,
|
||||
manufacturer: 'geeetech.com',
|
||||
purchaseDate: formatDate(DateTime(2025, 10, 10)),
|
||||
notes: 'Durable and strong, perfect for functional parts.',
|
||||
pices: 8,
|
||||
printingTemp: 207,
|
||||
bedTemp: 55,
|
||||
),
|
||||
FilamentModel(
|
||||
id: '3',
|
||||
name: 'Tinmorry',
|
||||
type: 'ASA',
|
||||
color: 'Black',
|
||||
weight: 1000.0,
|
||||
price: 16.01,
|
||||
pices: 1,
|
||||
manufacturer: 'tinmorry.com',
|
||||
purchaseDate: formatDate(DateTime(2026, 1, 10)),
|
||||
notes: 'Weather-resistant filament for outdoor use.',
|
||||
printingTemp: 265,
|
||||
bedTemp: 100,
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user