Implemented settings, new scan, enhanced UI/UX
This commit is contained in:
@ -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();
|
||||
|
||||
Reference in New Issue
Block a user