GiancarloCode/form_bloc

[FLUTTER 3] Warning: Operand of null-aware operation '?.' has type 'WidgetsBinding' which excludes null. #91

dJani97 opened this issue · 3 comments

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.

@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

Please, merge & make at least a pre-release of this.