Fintasys / emoji_picker_flutter

A Flutter package that provides an Emoji picker widget with 1500+ emojis in 8 categories.
MIT License
164 stars 125 forks source link

Flutter 3 fix #71

Closed fennelhans closed 2 years ago

fennelhans commented 2 years ago

In Flutter 3, WidgetsBinding.instance no longer requires a null safety check.

: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
../…/src/emoji_picker.dart:164
- 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../../../../bin/flutter/packages/flutter/lib/src/widgets/binding.dart').
package:flutter/…/widgets/binding.dart:1
        (value) => WidgetsBinding.instance!.addPostFrameCallback((_) {
fennelhans commented 2 years ago

This is how other teams are doing it, by the way: (WidgetsBinding.instance as WidgetsBinding).addObserver(this);

RoyalCoder88 commented 2 years ago

Got the same problem :( how to fix it? `../../../Documents/flutter/.pub-cache/hosted/pub.dartlang.org/emoji_picker_flutter-1.1.2/lib/src/emoji_picker.dart:164:35: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.

Fintasys commented 2 years ago

Thanks for addressing this issue, please have a look at my comment in the PR!

h1amza commented 2 years ago

Got the same problem : Capture