element_query 0.0.2 copy "element_query: ^0.0.2" to clipboard
element_query: ^0.0.2 copied to clipboard

discontinued
Dart 1 only

A polyfill for Element Query

example/example.dart

// Copyright (c) 2016, Man Hoang. All rights reserved. Use of this source code
// is governed by a BSD-style license that can be found in the LICENSE file.

import 'dart:html';
import 'package:element_query/element_query.dart' as eq;

main() {
  // Initialize Element Query.
  // This method is safe to be called multiple times.
  eq.init();

  // Register a selector with two checkpoints for min-width.
  eq.register('.main-pane', minWidths: ['600px', '1000px']);

  // Alternatively, we can register an element.
  //eq.register(document.querySelector('.main-pane'),
  //    minWidths: ['500px', '1000px']);

  document.querySelector('.left-pane')
    ..onClick.listen((e) {
      (e.target as Element).classes.toggle('expanded');
    })
    ..onTransitionEnd.listen((_) {
      eq.update();
    });
}
0
likes
30
pub points
0%
popularity

Publisher

unverified uploader

A polyfill for Element Query

Repository (GitHub)
View/report issues

License

BSD-3-Clause (LICENSE)

More

Packages that depend on element_query