js_util 0.2.0 copy "js_util: ^0.2.0" to clipboard
js_util: ^0.2.0 copied to clipboard

Dart 1 only

Utilities to access JavaScript from Dart.

example/js_util.dart

import 'dart:html';

import 'package:js_util/js_util.dart';

void main() {
  final jsObj = toJS({
    'people': [
      {'firstName': 'Kwang Yul', 'lastName': 'Seo'},
      {'firstName': 'DoHyung', 'lastName': 'Kim'},
      {'firstName': 'Kyusun', 'lastName': 'Kim'}
    ]
  });

  final people = getValue(jsObj, 'people');
  final firstPerson = people[0];
  final text =
      '${getValue(firstPerson, "firstName")} ${getValue(firstPerson, "lastName")}';
  document.querySelector('#container').innerHtml = text;
}
1
likes
30
points
16
downloads

Publisher

unverified uploader

Weekly Downloads

Utilities to access JavaScript from Dart.

Repository (GitHub)
View/report issues

License

BSD-3-Clause (license)

Dependencies

js, quiver_iterables

More

Packages that depend on js_util