Error: Unexpected null value. "StatelessWidget with ChangeNotifier"
Closed this issue · 1 comments
andre-ab commented
Error used controller with ChangeNotifier
Cod:
void listClick(GlobalKey widgetKey) async {
try {
// here ***********
await runAddToCartAnimation(widgetKey);
} catch (e) {
print(e);
}
await cartKey.currentState!.runCartAnimation((++cartTotalItems).toString());
}
andre-ab commented
Error used controller with ChangeNotifier
Cod:
void listClick(GlobalKey widgetKey) async { try { // here *********** await runAddToCartAnimation(widgetKey); } catch (e) { print(e); } await cartKey.currentState!.runCartAnimation((++cartTotalItems).toString());
}
I forgot to associate the key in the widget that has the animation
Container(
key: controller.widgetKey,
[...]
}