I am making a Text Editor application in flutter and want to use-
https://pub.dev/packages/flutter_quill
But, when I try to build the project after adding the dependency, I get the following error-
/D:/flutter_windows_2.10.5-stable/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_quill-6.3.2/lib/src/widgets/toolbar/quill_font_size_button.dart:113:41: Error: Property 'context' cannot be accessed on 'OverlayState?' because it is potentially null.
- 'OverlayState' is from 'package:flutter/src/widgets/overlay.dart' ('/D:/flutter_windows_2.10.5-stable/flutter/packages/flutter/lib/src/widgets/overlay.dart').
Try accessing using ?. instead.
final overlay = Overlay.of(context).context.findRenderObject() as RenderBox;
^^^^^^^
/D:/flutter_windows_2.10.5-stable/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_quill-6.3.2/lib/src/widgets/toolbar/quill_font_family_button.dart:112:41: Error: Property 'context' cannot be accessed on 'OverlayState?' because it is potentially null.
- 'OverlayState' is from 'package:flutter/src/widgets/overlay.dart' ('/D:/flutter_windows_2.10.5-stable/flutter/packages/flutter/lib/src/widgets/overlay.dart').
Try accessing using ?. instead.
final overlay = Overlay.of(context).context.findRenderObject() as RenderBox;
^^^^^^^
/D:/flutter_windows_2.10.5-stable/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_quill-6.3.2/lib/src/widgets/text_selection.dart:87:61: Error: The argument type 'OverlayState?' can't be assigned to the parameter type 'TickerProvider' because 'OverlayState?' is nullable and 'TickerProvider' isn't.
- 'OverlayState' is from 'package:flutter/src/widgets/overlay.dart' ('/D:/flutter_windows_2.10.5-stable/flutter/packages/flutter/lib/src/widgets/overlay.dart').
SDK Versions are-
compileSdkVersion 33
ndkVersion flutter.ndkVersion
minSdkVersion 30
targetSdkVersion 33
Please help me resolve this error.
2
Answers
i have same issue now T^T
anyone can solve this problem
I had the same issue. Just update the flutter version to latest stable version 3.7.0. The build error will disappear.