I’ve just upgraded to Flutter 3.13 and now my Flutter Windows app fails to compile..
[√] Flutter (Channel stable, 3.13.0, on Microsoft Windows [Version 10.0.19044.3086], locale en-GB)
[√] Windows Version (Installed version of Windows is version 10 or higher)
The following errors are reported…
Waiting for connection from debug service on Chrome...
/C:/Users/Ian/AppData/Local/Pub/Cache/hosted/pub.dev/sliver_tools-0.2.10/lib/src/sliver_stack.dart:282:55: Error: A value of type 'RenderObject?' can't be assigned to a variable of type 'AbstractNode?'.
- 'RenderObject' is from 'package:flutter/src/rendering/object.dart' ('../../sdk/flutter/packages/flutter/lib/src/rendering/object.dart').
- 'AbstractNode' is from 'package:flutter/src/foundation/node.dart' ('../../sdk/flutter/packages/flutter/lib/src/foundation/node.dart').
final AbstractNode? targetParent = renderObject.parent;
^
/C:/Users/Ian/AppData/Local/Pub/Cache/hosted/pub.dev/sliver_tools-0.2.10/lib/src/sliver_stack.dart:283:54: Error: The method 'markNeedsLayout' isn't defined for the class 'AbstractNode?'.
- 'AbstractNode' is from 'package:flutter/src/foundation/node.dart' ('../../sdk/flutter/packages/flutter/lib/src/foundation/node.dart').
Try correcting the name to the name of an existing method, or defining a method named 'markNeedsLayout'.
if (targetParent is RenderObject) targetParent.markNeedsLayout();
^^^^^^^^^^^^^^^
Any suggestions on how to fix this?
2
Answers
I found the answer at Flutter build web builds without sound null safety and runs on error
Solution was to run
flutter pub upgrade and flutter pub outdated then flutter pub get and it solved the issue
The issue occure when you update your Flutter version to the latest 3.13.0