https://github.com/bjesuiter/jb_media_query_service
An Angular Dart Service to register a listener function to media query updates without dealing with matchMedia
https://github.com/bjesuiter/jb_media_query_service
angular-service angulardart dart dartlang mediaqueries
Last synced: 4 months ago
JSON representation
An Angular Dart Service to register a listener function to media query updates without dealing with matchMedia
- Host: GitHub
- URL: https://github.com/bjesuiter/jb_media_query_service
- Owner: bjesuiter
- License: bsd-3-clause
- Created: 2018-01-25T11:53:33.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-01-25T12:39:09.000Z (over 7 years ago)
- Last Synced: 2025-03-11T14:55:13.669Z (4 months ago)
- Topics: angular-service, angulardart, dart, dartlang, mediaqueries
- Language: Dart
- Homepage: https://pub.dartlang.org/packages/jb_media_query_service
- Size: 60.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# 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