dart_browser_loader 1.0.0 copy "dart_browser_loader: ^1.0.0" to clipboard
dart_browser_loader: ^1.0.0 copied to clipboard

Platformweb

A starting point for Dart libraries or applications.

Dart

dart_browser_loader #

Import Javascript/Css... using Dart

await loadScript("https://code.jquery.com/jquery-3.2.1.min.js");
await loadLink("https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css");
await loadInlineStyle('''
  body {
    color: red;
  }
  ''');

It will add following element to dom.

<script type="text/javascript" async="" src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<link type="text/css" rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css">
<style>  body {
    color: red;
  }
 </style>

All function return future with element when link is valid or throw an error when invalid.

3
likes
130
points
2.61k
downloads

Publisher

verified publisherlefty.io

Weekly Downloads

A starting point for Dart libraries or applications.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

More

Packages that depend on dart_browser_loader