GAM3RG33K / flutter_settings_screens

Settings Screen with Custom Shared Preference Interface
MIT License
176 stars 71 forks source link

0.3.2-null-safety complaints about unnecessary WidgetsBinding.instance? null check. #82

Closed RoarGronmo closed 2 years ago

RoarGronmo commented 2 years ago

Getting theese warnings:

/C:/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_settings_screens-0.3.2-null-safety/lib/src/widgets/settings_widgets.dart:613:20: Warning: Operand of null-aware operation '?.' has type 'WidgetsBinding' which excludes null.
 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/C:/Flutter/flutter/packages/flutter/lib/src/widgets/binding.dart').
    WidgetsBinding.instance?.addPostFrameCallback((_) {
                   ^
DartUri: Unresolved uri: dart:web_sql
DartUri: Unresolved uri: dart:ui

Any hope for null safe release which addresses this particular problem ?

laogao commented 2 years ago

Maybe we could define and use some function such as T? _ambiguate<T>(T? value) => value; to wrap access to WidgetsBinding.instance, which treats values of both T and T? equally as T?. When everyone is on Flutter 3.0.0+, we can then drop it?

tarun-netweb commented 2 years ago

Same problem here:-

: Warning: Operand of null-aware operation '?.' has type 'WidgetsBinding' which excludes null. ../…/widgets/settings_widgets.dart:581

=================================== Can you solve it in next update ?

ec-ecss commented 2 years ago

Same here, the whole copy paste : ` ../../../tools/flutter-sdk/.pub-cache/hosted/pub.dartlang.org/flutter_settings_screens-0.3.3-null-safety+1/lib/src/widgets/settings_widgets.dart:676:20: Warning: Operand of null-aware operation '?.' has type 'WidgetsBinding' which excludes null.

GAM3RG33K commented 2 years ago

@nyxkn Can you take a look at these issues generated by the latest flutter stable/beta sdk update? I am planning to resolve this maybe during this weekend or by the end of next week.

If you can just the issues & provide a list of it here, we can connect over the weekend & get it done. I am sure it won't be a long list of changes for this.