Commit 7399508d by C0routine Committed by GitHub

[Fix] Deprecated webOnlyAssetManage -> assetManager (#490)

parent decd0b52
import 'dart:async'; import 'dart:async';
import 'dart:html' as html; import 'dart:html' as html;
import 'dart:ui' as ui; import 'dart:ui_web' as ui;
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_web_plugins/flutter_web_plugins.dart'; import 'package:flutter_web_plugins/flutter_web_plugins.dart';
...@@ -71,8 +71,7 @@ class FluttertoastWebPlugin { ...@@ -71,8 +71,7 @@ class FluttertoastWebPlugin {
final List<Future<void>> loading = <Future<void>>[]; final List<Future<void>> loading = <Future<void>>[];
final List<html.HtmlElement> tags = <html.HtmlElement>[]; final List<html.HtmlElement> tags = <html.HtmlElement>[];
// ignore: undefined_prefixed_name final cssUrl = ui.assetManager.getAssetUrl(
final cssUrl = ui.webOnlyAssetManager.getAssetUrl(
'packages/fluttertoast/assets/toastify.css', 'packages/fluttertoast/assets/toastify.css',
); );
final html.LinkElement css = html.LinkElement() final html.LinkElement css = html.LinkElement()
...@@ -80,9 +79,8 @@ class FluttertoastWebPlugin { ...@@ -80,9 +79,8 @@ class FluttertoastWebPlugin {
..attributes = {"rel": "stylesheet"} ..attributes = {"rel": "stylesheet"}
..href = cssUrl; ..href = cssUrl;
tags.add(css); tags.add(css);
// ignore: undefined_prefixed_name final jsUrl = ui.assetManager.getAssetUrl(
final jsUrl = ui.webOnlyAssetManager.getAssetUrl(
'packages/fluttertoast/assets/toastify.js', 'packages/fluttertoast/assets/toastify.js',
); );
final html.ScriptElement script = html.ScriptElement() final html.ScriptElement script = html.ScriptElement()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment