Purus / launch_review

A Flutter plugin to assist in leaving user reviews/ratings in the Google Play Store. Supports both Android and iOS.
https://pub.dartlang.org/packages/launch_review
MIT License
178 stars 117 forks source link

launch_review-3.0.1 LaunchReviewPlugin.java uses or overrides a deprecated API. #39

Open psdike opened 2 years ago

psdike commented 2 years ago

Hi, I am using this plugin for many of my applications. But now from last two apps I got this Note which is irritate me even my all plugins have updated version, flutter showing this note. Please check and let me know how to solve this.

lukaskurz commented 2 years ago

Same here

/home/lukaskurz/.pub-cache/hosted/pub.dartlang.org/launch_review-3.0.1/android/src/main/java/com/iyaffle/launchreview/LaunchReviewPlugin.java:11: warning: [deprecation] Registrar in PluginRegistry has been deprecated
import io.flutter.plugin.common.PluginRegistry.Registrar;
                                              ^
/home/lukaskurz/.pub-cache/hosted/pub.dartlang.org/launch_review-3.0.1/android/src/main/java/com/iyaffle/launchreview/LaunchReviewPlugin.java:41: warning: [deprecation] Registrar in PluginRegistry has been deprecated
    public static void registerWith(Registrar registrar) {
                                    ^
2 warnings

I am guessing this has to do with the backwards compatibility to v1 embedding, since registerWith and Registrar is no longer used in v2 embedding. The official guide for migrating to v2, still recommends keeping this for backwards compatibility.

Therefore I would recommend adding @SuppressWarnings("deprecation") above the function, as many other libraries do the same.

lukaskurz commented 2 years ago

if u check one of the official repos, like battery, they do the same

https://github.com/flutter/plugins/blob/master/packages/battery/battery/android/src/main/java/io/flutter/plugins/battery/BatteryPlugin.java