Skip to content

Commit b32ce84

Browse files
committed
[markdown, stream_transform] Fix deprecated usage of pkg:web
1 parent a4ae175 commit b32ce84

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

pkgs/markdown/example/app.dart

+10-8
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ final extensionSets = {
4040
};
4141

4242
void main() {
43-
versionSpan.text = 'v${md.version}';
43+
versionSpan.textContent = 'v${md.version}';
4444
markdownInput.onKeyUp.listen(_renderMarkdown);
4545

46-
final savedMarkdown = window.localStorage['markdown'];
46+
final savedMarkdown = window.localStorage.getItem('markdown');
4747

4848
if (savedMarkdown != null &&
4949
savedMarkdown.isNotEmpty &&
@@ -57,7 +57,7 @@ void main() {
5757

5858
// GitHub is the default extension set.
5959
gfmRadio.attributes.getNamedItem('checked')?.value = '';
60-
gfmRadio.querySelector('.glyph')!.text = 'radio_button_checked';
60+
gfmRadio.querySelector('.glyph')!.textContent = 'radio_button_checked';
6161
extensionSet = extensionSets[gfmRadio.id];
6262
_renderMarkdown();
6363

@@ -82,7 +82,7 @@ void _renderMarkdown([Event? event]) {
8282

8383
if (event != null) {
8484
// Not simulated typing. Store it.
85-
window.localStorage['markdown'] = markdown;
85+
window.localStorage.setItem('markdown', markdown);
8686
}
8787
}
8888

@@ -110,19 +110,21 @@ void _switchFlavor(Event e) {
110110
if (target.attributes.getNamedItem('checked') == null) {
111111
if (basicRadio != target) {
112112
basicRadio.attributes.safeRemove('checked');
113-
basicRadio.querySelector('.glyph')!.text = 'radio_button_unchecked';
113+
basicRadio.querySelector('.glyph')!.textContent =
114+
'radio_button_unchecked';
114115
}
115116
if (commonmarkRadio != target) {
116117
commonmarkRadio.attributes.safeRemove('checked');
117-
commonmarkRadio.querySelector('.glyph')!.text = 'radio_button_unchecked';
118+
commonmarkRadio.querySelector('.glyph')!.textContent =
119+
'radio_button_unchecked';
118120
}
119121
if (gfmRadio != target) {
120122
gfmRadio.attributes.safeRemove('checked');
121-
gfmRadio.querySelector('.glyph')!.text = 'radio_button_unchecked';
123+
gfmRadio.querySelector('.glyph')!.textContent = 'radio_button_unchecked';
122124
}
123125

124126
target.attributes.getNamedItem('checked')?.value = '';
125-
target.querySelector('.glyph')!.text = 'radio_button_checked';
127+
target.querySelector('.glyph')!.textContent = 'radio_button_checked';
126128
extensionSet = extensionSets[target.id];
127129
_renderMarkdown();
128130
}

pkgs/stream_transform/example/main.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ void main() {
1616
.tap((v) {
1717
print('Saw: $v');
1818
}).forEach((v) {
19-
output.text = v;
19+
output.textContent = v;
2020
});
2121
}
2222

0 commit comments

Comments
 (0)