Implemented settings, new scan, enhanced UI/UX

This commit is contained in:
Dennis Nemec
2025-11-04 16:52:39 +01:00
parent b19a6e1cd4
commit 7ea9108f62
79 changed files with 3306 additions and 566 deletions

View File

@ -25,17 +25,34 @@ class _DeliveryOptionsViewState extends State<DeliveryOptionsView> {
}
void _update(model.DeliveryOption option, dynamic value) {
debugPrint(option.key);
if (value is bool) {
context.read<DeliveryBloc>().add(
UpdateDeliveryOptionEvent(key: option.key, value: !value),
);
return;
}
context.read<DeliveryBloc>().add(
UpdateDeliveryOption(key: option.key, value: value),
UpdateDeliveryOptionEvent(key: option.key, value: value),
);
}
List<Widget> _options() {
List<Widget> boolOptions =
widget.options.where((option) => !option.numerical).map((option) {
debugPrint("Value: ${option.value}, Key: ${option.key}");
return CheckboxListTile(
value: option.getValue() as bool,
onChanged: (value) => _update(option, value),
value: option.getValue(),
onChanged: (value) {
debugPrint("HAHAHA");
debugPrint(value.toString());
_update(option, option.getValue());
},
title: Text(option.display),
);
}).toList();
@ -49,7 +66,9 @@ class _DeliveryOptionsViewState extends State<DeliveryOptionsView> {
initialValue: option.getValue().toString(),
keyboardType: TextInputType.number,
onTapOutside: (event) => FocusScope.of(context).unfocus(),
onChanged: (value) => _update(option, value),
onChanged: (value) {
_update(option, value);
},
),
);
}).toList();