P
P
panikev2021-07-26 09:48:53
Dart
panikev, 2021-07-26 09:48:53

How to change flutter class property?

Hello! There is a Nomenclature class, I'm trying to change the value of the count property in the controller, and the log tells me
I / flutter (20083): LateInitializationError: Field 'count' has already been initialized.
Please tell me what am I doing wrong?

Future add(Nomenclature nomenclature) async {

try {
nomenclature.count = 55;
var box = await Hive.openBox('nomenclaturesInCart2');
box.put(nomenclature.vendorCode, nomenclature);
box.close();
} catch (e) {
print(e);
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question