price per item is printed
This commit is contained in:
@@ -4,6 +4,7 @@ import 'package:uuid/uuid.dart';
|
||||
|
||||
import '../models/kauf_filament_model.dart';
|
||||
import '../models/bauteil_model.dart';
|
||||
import '../models/anwendung_model.dart';
|
||||
import '../helper/storage_keys.dart';
|
||||
import '../helper/filament_bestand.dart';
|
||||
import '../helper/display_formats.dart';
|
||||
@@ -18,6 +19,16 @@ class HomeController extends GetxController {
|
||||
|
||||
final filamente = <KaufFilamentModel>[].obs;
|
||||
final verbrauch = <String, double>{}.obs;
|
||||
final filamentIdsMitProfil = <String>{}.obs;
|
||||
|
||||
void loadProfile() {
|
||||
filamentIdsMitProfil.assignAll(
|
||||
storage
|
||||
.getModelList(StorageKeys.anwendungen)
|
||||
.map(AnwendungModel.fromJson)
|
||||
.map((profile) => profile.filamentId),
|
||||
);
|
||||
}
|
||||
|
||||
void loadVerbrauch() {
|
||||
verbrauch.assignAll(
|
||||
@@ -133,6 +144,7 @@ class HomeController extends GetxController {
|
||||
|
||||
void loadFilamente() {
|
||||
loadVerbrauch();
|
||||
loadProfile();
|
||||
final data = storage.getModelList(storageKey);
|
||||
|
||||
filamente.assignAll(data.map(KaufFilamentModel.fromJson));
|
||||
|
||||
Reference in New Issue
Block a user