Skip to content

Commit

Permalink
[Fix] Deprecated webOnlyAssetManage -> assetManager (#490)
Browse files Browse the repository at this point in the history
  • Loading branch information
C0routine committed Apr 14, 2024
1 parent decd0b5 commit 7399508
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lib/fluttertoast_web.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'dart:async';
import 'dart:html' as html;
import 'dart:ui' as ui;
import 'dart:ui_web' as ui;
import 'package:flutter/services.dart';
import 'package:flutter_web_plugins/flutter_web_plugins.dart';

Expand Down Expand Up @@ -71,18 +71,16 @@ class FluttertoastWebPlugin {
final List<Future<void>> loading = <Future<void>>[];
final List<html.HtmlElement> tags = <html.HtmlElement>[];

// ignore: undefined_prefixed_name
final cssUrl = ui.webOnlyAssetManager.getAssetUrl(
final cssUrl = ui.assetManager.getAssetUrl(
'packages/fluttertoast/assets/toastify.css',
);
final html.LinkElement css = html.LinkElement()
..id = 'toast-css'
..attributes = {"rel": "stylesheet"}
..href = cssUrl;
tags.add(css);

// ignore: undefined_prefixed_name
final jsUrl = ui.webOnlyAssetManager.getAssetUrl(

final jsUrl = ui.assetManager.getAssetUrl(
'packages/fluttertoast/assets/toastify.js',
);
final html.ScriptElement script = html.ScriptElement()
Expand Down

0 comments on commit 7399508

Please sign in to comment.