Coder Social home page Coder Social logo

bjesuiter / jb_media_query_service Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 62 KB

An Angular Dart Service to register a listener function to media query updates without dealing with matchMedia

Home Page: https://pub.dartlang.org/packages/jb_media_query_service

License: BSD 3-Clause "New" or "Revised" License

HTML 15.47% Dart 84.53%
dart dartlang angulardart mediaqueries angular-service

jb_media_query_service's Introduction

jb_responsive_breakpoints

An Angular Dart Service to register a listener function to media query updates without dealing with matchMedia.

How to use

Declare JbMediaQueryService as provider, inject it into your component
(called mqService in example) and call
mqService.register(callbackFunction, minWidth: 300)
or
mqService.registerStringQuery(callbackFunction, '(minWidth:600px)'.

The register method provides a shortcut for the most used media queries, currently min-width and min-height media queries. If both are given, they will be connected by and. The registerStringQuery method allows you to register an arbitrary mediaQuery which is accepted by window.matchMedia.

Example

Please look at the example folder in the Github Repository.

Build 'System'

The build system consists of a script system with the 'scripts' package for dart. This works analoguous to the npm scripts feature.
https://pub.dartlang.org/packages/scripts#-readme-tab-

Activate Scripts

pub global activate scripts

Basic Scripts Commands

  • scripts get
  • scripts install
  • scripts clean
  • scripts (see pubspec.yaml)

Custom Scripts Commands

  • check-pkg - checks package health for pub.dartlang.org with the pana package
  • format-src - format sources with dartfmt

jb_media_query_service's People

Contributors

bjesuiter avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.