It is possible to perform media queries in Dart in order to retrieve some information such as the user’s device preferences as to which theme to use, dark or light.
Documentation about this can be found in the W3C level 5 draft here. In Javascript, it is possible to send a media query with .matchMedia('(prefers-color-scheme: dark)') in order to detect if the user prefers a dark theme. The possible values are:
no-preference
light
dark
In Dart, it is also possible to perform media queries with dart:html’s window and its styleMedia member, which has the method matchMedium.
It should be easy to add in the initializing Dart code a couple of lines that look for the user’s preferences and set the default theme accordingly.
It is possible to perform media queries in Dart in order to retrieve some information such as the user’s device preferences as to which theme to use, dark or light.
Documentation about this can be found in the W3C level 5 draft [here](https://drafts.csswg.org/mediaqueries-5/#descdef-media-prefers-color-scheme). In Javascript, it is possible to send a media query with `.matchMedia('(prefers-color-scheme: dark)')` in order to detect if the user prefers a dark theme. The possible values are:
- `no-preference`
- `light`
- `dark`
In Dart, it is also possible to perform media queries with `dart:html`’s [`window`](https://api.dart.dev/stable/2.8.1/dart-html/window.html) and its `styleMedia` member, which has the method [`matchMedium`](https://api.dart.dev/stable/2.8.1/dart-html/StyleMedia/matchMedium.html).
It should be easy to add in the initializing Dart code a couple of lines that look for the user’s preferences and set the default theme accordingly.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
It is possible to perform media queries in Dart in order to retrieve some information such as the user’s device preferences as to which theme to use, dark or light.
Documentation about this can be found in the W3C level 5 draft here. In Javascript, it is possible to send a media query with
.matchMedia('(prefers-color-scheme: dark)')in order to detect if the user prefers a dark theme. The possible values are:no-preferencelightdarkIn Dart, it is also possible to perform media queries with
dart:html’swindowand itsstyleMediamember, which has the methodmatchMedium.It should be easy to add in the initializing Dart code a couple of lines that look for the user’s preferences and set the default theme accordingly.