mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 08:44:27 +00:00
[dart:html] add syntax highlighting to code blocks
Change-Id: I7dc008c01e776be8010da4845b3dc95643e34194 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202401 Auto-Submit: Sigmund Cherem <sigmund@google.com> Commit-Queue: Sigmund Cherem <sigmund@google.com> Commit-Queue: Srujan Gaddam <srujzs@google.com> Reviewed-by: Srujan Gaddam <srujzs@google.com>
This commit is contained in:
parent
e2178cecfc
commit
80160d3efb
1 changed files with 4 additions and 4 deletions
|
@ -26,7 +26,7 @@ Let’s look at an example. `FileReader` is a `dart:html` interface that is
|
|||
missing the API `readAsBinaryString` ([#42834][]). We can work around this by
|
||||
doing something like the following:
|
||||
|
||||
```
|
||||
```dart
|
||||
import 'dart:html';
|
||||
import 'dart:js_util' as js_util;
|
||||
|
||||
|
@ -50,7 +50,7 @@ In the case where the API is missing a constructor, we can use
|
|||
`callConstructor`. For example, instead of using the factory constructor for
|
||||
`KeyboardEvent`, we can do the following:
|
||||
|
||||
```
|
||||
```dart
|
||||
import 'dart:html';
|
||||
import 'dart:js_util' as js_util;
|
||||
|
||||
|
@ -77,7 +77,7 @@ attributes associated with this interface. We can use the `js_util` library
|
|||
again to circumvent this issue. For example, we can manipulate a
|
||||
`_SubtleCrypto` object:
|
||||
|
||||
```
|
||||
```dart
|
||||
import 'dart:html';
|
||||
import 'dart:js_util' as js_util;
|
||||
import 'dart:typed_data';
|
||||
|
@ -99,7 +99,7 @@ void main() async {
|
|||
What you shouldn’t do is attempt to cast these native objects using your own JS
|
||||
interop types, e.g.
|
||||
|
||||
```
|
||||
```dart
|
||||
import 'dart:html';
|
||||
|
||||
import 'package:js/js.dart';
|
||||
|
|
Loading…
Reference in a new issue