Skip to content

Commit 2bb935f

Browse files
authored
update stream_transform example to package:web
Fixes a deprecation warning from the latest SDK.
2 parents 070355e + 54ba3b1 commit 2bb935f

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

.github/workflows/stream_transform.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
# Add macos-latest and/or windows-latest if relevant for this package.
6060
os: [ubuntu-latest]
6161
# Bump SDK for Legacy tests when changing min SDK.
62-
sdk: [3.1, dev]
62+
sdk: [3.4, dev]
6363
steps:
6464
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
6565
- uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94

pkgs/stream_transform/CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
## 2.1.2-wip
22

3+
- Require Dart 3.4 or greater.
4+
35
## 2.1.1
46

57
- Require Dart 3.1 or greater

pkgs/stream_transform/example/main.dart

+4-5
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
import 'dart:html';
6-
75
import 'package:stream_transform/stream_transform.dart';
6+
import 'package:web/web.dart';
87

98
void main() {
10-
var firstInput = document.querySelector('#first_input') as InputElement;
11-
var secondInput = document.querySelector('#second_input') as InputElement;
9+
var firstInput = document.querySelector('#first_input') as HTMLInputElement;
10+
var secondInput = document.querySelector('#second_input') as HTMLInputElement;
1211
var output = document.querySelector('#output')!;
1312

1413
_inputValues(firstInput)
@@ -21,6 +20,6 @@ void main() {
2120
});
2221
}
2322

24-
Stream<String?> _inputValues(InputElement element) => element.onKeyUp
23+
Stream<String?> _inputValues(HTMLInputElement element) => element.onKeyUp
2524
.debounce(const Duration(milliseconds: 100))
2625
.map((_) => element.value);

pkgs/stream_transform/pubspec.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ description: A collection of utilities to transform and manipulate streams.
44
repository: https://github.com/dart-lang/tools/tree/main/pkgs/stream_transform
55

66
environment:
7-
sdk: ^3.1.0
7+
sdk: ^3.4.0
88

99
dev_dependencies:
1010
async: ^2.5.0
1111
dart_flutter_team_lints: ^3.0.0
1212
fake_async: ^1.3.0
1313
test: ^1.16.0
14+
web: ^1.1.0

0 commit comments

Comments
 (0)