Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FlutterToast uses deprecated webOnlyAssetManager getter instead of assetManager from dart:ui_web #485

Open
kevan-mtl opened this issue Jan 1, 2024 · 2 comments

Comments

@kevan-mtl
Copy link

kevan-mtl commented Jan 1, 2024

Hi everyone,

In the file fluttertoast_web.dart, the following lines use a deprecated API:

final jsUrl = ui.webOnlyAssetManager.getAssetUrl(
      'packages/fluttertoast/assets/toastify.js',
    );

Indeed, it's a deprecated method according to Flutter (at least on v3.16.3), see below warning message when running on web:

The webOnlyAssetManager getter is deprecated and will be removed in a future release. Please use `assetManager` from `dart:ui_web` instead.
@JohnOwais
Copy link

              Fluttertoast.showToast(
                msg: 'Success',
                toastLength: Toast.LENGTH_SHORT,
                gravity: ToastGravity.CENTER,
                backgroundColor: Colors.green,
                textColor: Colors.white,
                fontSize: 16.0,
              );

Warning: The webOnlyAssetManager getter is deprecated and will be removed in a future release. Please use assetManager from
dart:ui_web instead.

@amrgetment
Copy link

@ponnamkarthik could you review the open PR so we don't get the warning while running on web
Thanks in advance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants