[FLUTTER 3] Warning: Operand of null-aware operation '?.' has type 'WidgetsBinding' which excludes null. #91
dJani97 opened this issue · 3 comments
dJani97 commented
Describe the bug
When running the project, a couple of warnings like this are displayed:
../../AppData/Local/Pub/Cache/hosted/pub.dartlang.org/flutter_form_bloc-0.30.1/lib/src/flutter_typeahead.dart:985:22: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
- 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/C:/Apps/flutter/packages/flutter/lib/src/widgets/binding.dart').
WidgetsBinding.instance!.addPostFrameCallback((duration) {
^
In Flutter 3, WidgetsBinding.instance is no longer nullable, so the ?.
operator is not necessary.
To Reproduce
Reproducible by using Flutter 3 and flutter_form_bloc: ^0.30.1
.
vasilich6107 commented
@dJani97
This is not the first time when form_bloc has issues with delivery
Today I removed last piece of code and form_bloc
as dependancy.
I recommend you pay attaention to reactive_forms
- form itself https://pub.dev/packages/reactive_forms
- a lot of prebuilt widgets ready to use https://github.com/artflutter/reactive_forms_widgets
- code gen for strictly typed forms https://github.com/artflutter/reactive_forms_generator
dJani97 commented
Please, merge & make at least a pre-release of this.
vasilich6107 commented