Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
126 commits
Select commit Hold shift + click to select a range
947e34c
[flutter_markdown] Replace deprecated API (#6134)
stuartmorgan-g Feb 20, 2024
8bba41b
Roll Flutter from 064c340baf0e to 5129806e6c63 (9 revisions) (#6164)
engine-flutter-autoroll Feb 20, 2024
b21dce5
[web] Updates package:web dependency to ^0.5.0. (#5791)
kevmoo Feb 20, 2024
48048f6
[google_sign_in_web] Updates package:web dependency to 0.5.0. (#6167)
ditman Feb 20, 2024
cd5d7d8
[local_auth] Switch iOS endorsement to `local_auth_darwin` (#6107)
stuartmorgan-g Feb 21, 2024
e88ca69
[camera_android_camerax] Fix typo in readme (#6143)
Bassiuz Feb 21, 2024
5f44e3d
[url_launcher] Remove `renderView` usage (#6137)
stuartmorgan-g Feb 21, 2024
9c15ec5
[ci] Run Windows Arm64 build tests post-submit (#6166)
loic-sharma Feb 21, 2024
ed046de
[flutter_markdown] Support wasm (#6168)
kevmoo Feb 21, 2024
ccb27be
[various] Commit Windows build migrations (#6175)
stuartmorgan-g Feb 21, 2024
83d7fc6
[camerax] Implements `setFocusPoint`, `setExposurePoint`, `setExposur…
camsim99 Feb 21, 2024
784190c
[camerax] Modifies initialized camera info to reflect default AF/AE m…
camsim99 Feb 21, 2024
1c11001
[in_app_purchase] Convert refreshReceipt(), startObservingPaymentQueu…
LouiseHsu Feb 21, 2024
291d9d9
Manual roll Flutter (stable) from bae5e49bc2a8 to abb292a07e20 (1 rev…
engine-flutter-autoroll Feb 22, 2024
078c2a3
Manual roll Flutter from 5129806e6c63 to efee280cfa93 (47 revisions) …
engine-flutter-autoroll Feb 22, 2024
ff587b7
Roll Flutter from efee280cfa93 to 41581c9a1b90 (1 revision) (#6181)
engine-flutter-autoroll Feb 22, 2024
67470fc
[two_dimensional_scrollables] Fix layout offset of merged pinned cell…
Piinks Feb 22, 2024
7df2085
[web] Removes a few deprecated API usages. (#6177)
ditman Feb 22, 2024
f191932
Bump github/codeql-action from 3.24.3 to 3.24.4 (#6184)
dependabot[bot] Feb 23, 2024
74eeb29
[camera] Document -1 return value for `getExposureOffsetStepSize` (#6…
camsim99 Feb 23, 2024
fe6111b
Roll Flutter from 41581c9a1b90 to 39585e66c11f (31 revisions) (#6194)
engine-flutter-autoroll Feb 23, 2024
41f5a16
Roll Flutter from 39585e66c11f to f6c10820fa30 (20 revisions) (#6200)
engine-flutter-autoroll Feb 24, 2024
7f7b715
Roll Flutter from f6c10820fa30 to 1e8dd1e4d6d7 (3 revisions) (#6203)
engine-flutter-autoroll Feb 25, 2024
25d9c9d
Bump github/codeql-action from 3.24.4 to 3.24.5 (#6204)
dependabot[bot] Feb 26, 2024
353086c
[google_map_flutter] Add style to widget - platform interface (#6197)
stuartmorgan-g Feb 26, 2024
f9171d1
Roll Flutter from 1e8dd1e4d6d7 to b77560e92a58 (8 revisions) (#6207)
engine-flutter-autoroll Feb 26, 2024
0aff69f
[tool] Ignore GeneratedPluginRegistrant.swift for `format` (#6195)
stuartmorgan-g Feb 26, 2024
6e83506
[pigeon] Fix tool hangs on verbose sub-processes (#6198)
loic-sharma Feb 26, 2024
5e03e0f
[url_launcher] Add explicit imports of UIKit (#6208)
ChristianEdwardPadilla Feb 26, 2024
91d11d6
Add `InkResponse`, `Material` and fix `Opacity` (#6199)
peixinli Feb 26, 2024
bc51dea
Roll Flutter from b77560e92a58 to c30f998eb5db (12 revisions) (#6211)
engine-flutter-autoroll Feb 27, 2024
e07eb50
[camerax] Implements `setExposureMode` (#6110)
camsim99 Feb 27, 2024
679bdd7
[pigeon] Allows kotlin generator to skip error class generation (#6183)
tarrinneal Feb 27, 2024
5ff00b2
[pigeon] Remove heap allocation in generated C++ code (#6196)
loic-sharma Feb 28, 2024
7cdcf30
[google_maps_flutter_web] Migrate to package:web (#5254)
navaronbracke Feb 28, 2024
3214a67
[google_map_flutter] Add style to widget - platform impls (#6205)
stuartmorgan-g Feb 28, 2024
ccec918
Add library annotations for js interop (#6216)
srujzs Feb 28, 2024
930318a
[google_maps_flutter] Add `style` to widget (#6192)
stuartmorgan-g Feb 28, 2024
6d02f03
Manual roll Flutter from c30f998eb5db to d00bfe820eef (32 revisions) …
engine-flutter-autoroll Feb 28, 2024
a1c5006
Roll Flutter from d00bfe820eef to e92bca3ff5d2 (15 revisions) (#6227)
engine-flutter-autoroll Feb 29, 2024
8e2202d
Roll Flutter (stable) from abb292a07e20 to 7482962148e8 (1 revision) …
engine-flutter-autoroll Feb 29, 2024
b3f10aa
[google_maps_flutter] Add support for marker clustering - platform in…
jokerttu Feb 29, 2024
268f7d5
[various] Standardize Obj-C doc comment style (#6232)
stuartmorgan-g Feb 29, 2024
a9c68b8
Bump github/codeql-action from 3.24.5 to 3.24.6 (#6234)
dependabot[bot] Mar 1, 2024
06c1fa4
[camera_avfoundation] Set highest available resolution for Resolution…
sergeidesenko Mar 1, 2024
8ccf7f6
Roll Flutter from e92bca3ff5d2 to ba719bc588ed (37 revisions) (#6235)
engine-flutter-autoroll Mar 1, 2024
0625827
Roll Flutter from ba719bc588ed to 65cd84b58885 (5 revisions) (#6239)
engine-flutter-autoroll Mar 2, 2024
05f97df
[webview_flutter] Make WebKitWebViewWidget unit tests stateless (#6228)
stuartmorgan-g Mar 4, 2024
5fed047
[flutter_markdown] Fix WidgetSpan Support in MarkdownElementBuilder (…
pzierahn Mar 5, 2024
4a9c4be
[pigeon] Separates message call code generation into separate methods…
bparrishMines Mar 5, 2024
4ece1dd
[video_player] Fix typo in readme (#6264)
Slowhand0309 Mar 5, 2024
2aa6e3f
[in_app_purchase_storekit] Fix type of error code returned from nativ…
blaugold Mar 5, 2024
4200177
Roll Flutter from 65cd84b58885 to 3b5a2ecf992d (26 revisions) (#6269)
engine-flutter-autoroll Mar 5, 2024
83b72ba
[web] Use TrustedTypes from pkg web. (#6273)
ditman Mar 5, 2024
6a4e2ff
[tool] Add features to support GCB auto-publish flow (#6218)
stuartmorgan-g Mar 5, 2024
b5fe05d
[in_app_purchase_storekit] backfill native tests for more complete te…
LouiseHsu Mar 5, 2024
10cd61c
[rfw] Change test coverage logic to enforce 100% coverage (#6272)
Hixie Mar 5, 2024
79faa24
[in_app_pur]: Bump org.json:json from 20240205 to 20240303 in /packag…
dependabot[bot] Mar 6, 2024
b097d99
[video_player_web] migrates to package:web (#5800)
balvinderz Mar 6, 2024
9b88dbc
[image_picker_for_web] migrates to package:web (#5799)
balvinderz Mar 6, 2024
cc3f2a3
Roll Flutter from 3b5a2ecf992d to 8f84f3f32ddc (18 revisions) (#6276)
engine-flutter-autoroll Mar 6, 2024
ceb3dfd
[in_app_purchase_storekit] Handle translation of errors nested in dic…
blaugold Mar 6, 2024
6701c9e
[rfw] Add support for widget builders (#5907)
tugorez Mar 6, 2024
903f03a
Roll Flutter from 8f84f3f32ddc to 471a82856d86 (27 revisions) (#6281)
engine-flutter-autoroll Mar 7, 2024
0badb43
[two_dimensional_scrollables] Fix another combo of pinned/unpinned me…
Piinks Mar 7, 2024
6860fdf
Roll Flutter (stable) from 7482962148e8 to ba3931984302 (2 revisions)…
engine-flutter-autoroll Mar 8, 2024
a10b360
Roll Flutter from 471a82856d86 to 7c89ec8bbc6d (15 revisions) (#6288)
engine-flutter-autoroll Mar 8, 2024
d489d84
[in_app_purchase_android] Add UserChoiceBilling mode. (#6162)
reidbaker Mar 8, 2024
3eb794b
Manual roll Flutter from 7c89ec8bbc6d to 3bb2e5948e7a (31 revisions) …
engine-flutter-autoroll Mar 11, 2024
1e46a6a
Roll Flutter from 7c89ec8bbc6d to 3bb2e5948e7a (31 revisions) (#6300)
engine-flutter-autoroll Mar 11, 2024
d1aeb26
Manual roll Flutter from 3bb2e5948e7a to 1ca88730a0c1 (11 revisions) …
engine-flutter-autoroll Mar 12, 2024
38711ac
Roll Flutter from 1ca88730a0c1 to 61812ca3eb13 (1 revision) (#6305)
engine-flutter-autoroll Mar 12, 2024
142a604
Bump github/codeql-action from 3.24.6 to 3.24.7 (#6310)
dependabot[bot] Mar 13, 2024
131033e
Replace deprecated UIGraphicsBeginImageContextWithOptions with UIGrap…
jmagman Mar 13, 2024
be216b6
Bump actions/checkout from 4.1.1 to 4.1.2 (#6309)
dependabot[bot] Mar 13, 2024
1601b4b
Manual roll Flutter from 61812ca3eb13 to 394269f9ea2e (6 revisions) (…
engine-flutter-autoroll Mar 13, 2024
b21c542
Support overriding `ErrorWidget.builder` (#6302)
peixinli Mar 14, 2024
2218300
[google_maps_flutter] Started dispatching platform messages from plat…
gaaclarke Mar 14, 2024
e8ab632
[image_picker_android] Fix deprecation warnings by branching based on…
gmackall Mar 14, 2024
92a8b7a
[webview_flutter_android][webview_flutter_wkwebview] Adds platform im…
bparrishMines Mar 14, 2024
0895119
[pigeon] Fixes double prefixes added to enum names for Objc HostApis …
bparrishMines Mar 14, 2024
6db47f4
[camera_web][google_maps_flutter] Fix tests throwing errors after tes…
bparrishMines Mar 15, 2024
756dcc1
[go_router] Use `leak_tracker_flutter_testing` (#6210)
ValentinVignal Mar 15, 2024
0a49d24
[pigeon]Add hellohuanlin to pigeon iOS for code reviews (#6333)
hellohuanlin Mar 15, 2024
9aa208a
[pointer_interceptor_web] Skip broken semantics tests and do a manual…
bparrishMines Mar 16, 2024
a757073
Roll Flutter from 71606af8d82e to 7c860ddf9705 (21 revisions) (#6345)
engine-flutter-autoroll Mar 17, 2024
1b9bab3
[flutter_markdown] Adds onSelectionChanged in Markdown (#6169)
leiatfly Mar 18, 2024
02128ee
Roll Flutter from 7c860ddf9705 to f217fc173918 (9 revisions) (#6350)
engine-flutter-autoroll Mar 18, 2024
a2f4ce0
[sign_in]: Bump com.google.android.gms:play-services-auth from 20.7.0…
dependabot[bot] Mar 18, 2024
52ed702
Roll Flutter from f217fc173918 to d31a85ba5c5e (23 revisions) (#6356)
engine-flutter-autoroll Mar 19, 2024
3be3ec1
[camerax] Implements `setFocusMode` (#6176)
camsim99 Mar 19, 2024
da16269
[pigeon] Adds Dart implementation of ProxyApi (#6043)
bparrishMines Mar 19, 2024
bb247f7
[flutter_markdown] Allow for custom block element (#5815)
dawidope Mar 19, 2024
23e56af
[camerax] Update README to encourage users to opt in (#6352)
camsim99 Mar 19, 2024
6975ba7
Roll Flutter from d31a85ba5c5e to b96c13d1e9ff (19 revisions) (#6359)
engine-flutter-autoroll Mar 20, 2024
8df9848
[camera_android] Update README to encourage users to use CameraX impl…
camsim99 Mar 20, 2024
b7fbe68
[adaptive_scaffold] : 🐛 #141938 - Drawer stays open even on destinati…
aliasgar4558 Mar 21, 2024
7cc7e31
[adaptive_scaffold] : 🐛 : #110902 : Assertion added when try with les…
aliasgar4558 Mar 21, 2024
352ddac
[flutter_adaptive_scaffold] Remove broken link from README (#6364)
stuartmorgan-g Mar 21, 2024
04b8ecc
Roll Flutter (stable) from ba3931984302 to 68bfaea22488 (2 revisions)…
engine-flutter-autoroll Mar 21, 2024
611aea1
Roll Flutter from b96c13d1e9ff to 18340ea16cee (26 revisions) (#6370)
engine-flutter-autoroll Mar 21, 2024
28d126c
Roll Flutter from 18340ea16cee to 14774b95c250 (20 revisions) (#6376)
engine-flutter-autoroll Mar 25, 2024
ab1630b
[pigeon] Adds @SwiftClass annotation (#6372)
tarrinneal Mar 26, 2024
333d43c
[in_app_pur]: Bump org.json:json from 20231013 to 20240303 in /packag…
dependabot[bot] Mar 26, 2024
c16c956
Roll Flutter from 14774b95c250 to dbdcead93225 (38 revisions) (#6399)
engine-flutter-autoroll Mar 26, 2024
014cf20
Bump github/codeql-action from 3.24.7 to 3.24.9 (#6386)
dependabot[bot] Mar 26, 2024
01d16a4
[flutter_lints] Updates various links (#6400)
goderbauer Mar 26, 2024
00d29b1
[google_maps_flutter] Fix ios tile overlay not loading when dealing w…
LouiseHsu Mar 27, 2024
e6b3e11
[camera]: Bump androidx.annotation:annotation from 1.7.0 to 1.7.1 in …
dependabot[bot] Mar 27, 2024
f61723b
[camerax] Use `AspectRatioStrategy` to help automatic selection of ex…
camsim99 Mar 27, 2024
72669d5
[interactive_media_ads] Creates and adds the `interactive_media_ads` …
bparrishMines Mar 27, 2024
974f284
Reverts "[interactive_media_ads] Creates and adds the `interactive_me…
auto-submit[bot] Mar 28, 2024
e234425
[ci] Temporarily allow-warnings in podspec_check_command.dart (#6416)
ditman Mar 28, 2024
924c7e6
Reverts "[ci] Temporarily allow-warnings in podspec_check_command.dar…
auto-submit[bot] Mar 28, 2024
88a02f0
[google_sign_in_ios] Pins GoogleSignIn to 7.0.0 in podspec. (#6430)
ditman Mar 28, 2024
ead738f
[interactive_media_ads] Reland "Creates and adds the interactive_medi…
bparrishMines Mar 28, 2024
c7d30e2
[go_router]: fix GoRouter.optionURLReflectsImperativeAPIs flag works …
anisovdev Mar 28, 2024
6d86800
[ci] Adds sleep 60s to release action. (#6405)
ditman Mar 28, 2024
fbf44e2
Manual roll Flutter from dbdcead93225 to 89ea49204b37 (54 revisions) …
engine-flutter-autoroll Mar 28, 2024
286c94e
[image_picker]: Bump androidx.exifinterface:exifinterface from 1.3.6 …
dependabot[bot] Mar 28, 2024
ad0274a
Manual roll Flutter (stable) from 68bfaea22488 to 300451adae58 (2 rev…
engine-flutter-autoroll Mar 29, 2024
51faaa1
[shared_preferences] Update mockito to the new version available 5.2.…
krupikivan Mar 29, 2024
302e73c
[two_dimensional_scrollables] Infinite TableView (#6411)
Piinks Mar 29, 2024
67d9025
Roll Flutter from 89ea49204b37 to 85288818b59e (11 revisions) (#6436)
engine-flutter-autoroll Mar 29, 2024
d5aff19
Roll Flutter from 85288818b59e to d12ba5c270d8 (21 revisions) (#6440)
engine-flutter-autoroll Mar 30, 2024
8fcffdd
Move integration_test dependency from regular dependencies to test de…
reidbaker Apr 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[web] Updates package:web dependency to ^0.5.0. (flutter#5791)
This PR updates the packages that are using `package:web` to version `^0.5.0`.

Ancilliary changes:

* Bump `environment` to `flutter: ">=3.19.0"` and `sdk: ^3.3.0`.
* Bump version to next `Y`
* Clean-up code that was kept for compatibility with versions of `web: <0.5.0`.

The main exception to this is `package:google_sign_in_web`, which depends on a version of `google_identity_services_web` that has a dependency on package:web that is `<0.5.0`, so that package needs to have a range until `google_identity_services_web` gets published with the new ^0.5.0 dependency.

Co-Authored-By: David Iglesias<[email protected]>
  • Loading branch information
kevmoo authored Feb 20, 2024
commit b21dce5f4964adf1e6c90225377a00f65652c428
5 changes: 3 additions & 2 deletions packages/cross_file/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## NEXT
## 0.3.4

* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1.
* Updates to web code to package `web: ^0.5.0`.
* Updates SDK version to Dart `^3.3.0`.

## 0.3.3+8

Expand Down
8 changes: 2 additions & 6 deletions packages/cross_file/lib/src/types/html.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,7 @@ class XFile extends XFileBase {
super(path) {
if (path == null) {
_browserBlob = _createBlobFromBytes(bytes, mimeType);
// TODO(kevmoo): drop ignore when pkg:web constraint excludes v0.3
// ignore: unnecessary_cast
_path = URL.createObjectURL(_browserBlob! as JSObject);
_path = URL.createObjectURL(_browserBlob!);
} else {
_path = path;
}
Expand Down Expand Up @@ -131,9 +129,7 @@ class XFile extends XFileBase {

// Attempt to re-hydrate the blob from the `path` via a (local) HttpRequest.
// Note that safari hangs if the Blob is >=4GB, so bail out in that case.
// TODO(kevmoo): Remove ignore and fix when the MIN Dart SDK is 3.3
// ignore: unnecessary_non_null_assertion
if (isSafari() && _length != null && _length! >= _fourGigabytes) {
if (isSafari() && _length != null && _length >= _fourGigabytes) {
throw Exception('Safari cannot handle XFiles larger than 4GB.');
}

Expand Down
6 changes: 3 additions & 3 deletions packages/cross_file/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ name: cross_file
description: An abstraction to allow working with files across multiple platforms.
repository: https://github.com/flutter/packages/tree/main/packages/cross_file
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+cross_file%22
version: 0.3.3+8
version: 0.3.4

environment:
sdk: ^3.2.0
sdk: ^3.3.0

dependencies:
meta: ^1.3.0
web: '>=0.3.0 <0.5.0'
web: ^0.5.0

dev_dependencies:
path: ^1.8.1
Expand Down
6 changes: 3 additions & 3 deletions packages/cross_file/test/x_file_html_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ void main() {
test('Stores data as a Blob', () async {
// Read the blob from its path 'natively'
final html.Response response =
(await html.window.fetch(file.path.toJS).toDart)! as html.Response;
await html.window.fetch(file.path.toJS).toDart;

final JSAny? arrayBuffer = await response.arrayBuffer().toDart;
final ByteBuffer data = (arrayBuffer! as JSArrayBuffer).toDart;
final JSAny arrayBuffer = await response.arrayBuffer().toDart;
final ByteBuffer data = (arrayBuffer as JSArrayBuffer).toDart;
expect(data.asUint8List(), equals(bytes));
});

Expand Down
5 changes: 3 additions & 2 deletions packages/file_selector/file_selector_web/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## NEXT
## 0.9.4

* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1.
* Updates web code to package `web: ^0.5.0`.
* Updates SDK version to Dart `^3.3.0`. Flutter `^3.16.0`.

## 0.9.3

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ void main() {

FileList? createFileList(List<File> files) {
final DataTransfer dataTransfer = DataTransfer();
// Tear-offs of external extension type interop member 'add' are disallowed.
// ignore: prefer_foreach
for (final File e in files) {
// TODO(srujzs): This is necessary in order to support package:web 0.4.0.
// This was not needed with 0.3.0, hence the lint.
// ignore: unnecessary_cast
dataTransfer.items.add(e as JSAny);
dataTransfer.items.add(e);
}
return dataTransfer.files;
}
Expand All @@ -46,13 +45,8 @@ void main() {
});

group('getFiles', () {
final File mockFile1 =
// TODO(srujzs): Remove once typed JSArrays (JSArray<T>) get to `stable`.
// ignore: always_specify_types
File(<Object>['123456'].jsify as JSArray, 'file1.txt');
// TODO(srujzs): Remove once typed JSArrays (JSArray<T>) get to `stable`.
// ignore: always_specify_types
final File mockFile2 = File(<Object>[].jsify as JSArray, 'file2.txt');
final File mockFile1 = File(<JSAny>['123456'.toJS].toJS, 'file1.txt');
final File mockFile2 = File(<JSAny>[].toJS, 'file2.txt');

testWidgets('works', (_) async {
final Future<List<XFile>> futureFiles = domHelper.getFiles(
Expand Down Expand Up @@ -114,32 +108,27 @@ void main() {
testWidgets('sets the <input /> attributes and clicks it', (_) async {
const String accept = '.jpg,.png';
const bool multiple = true;
bool wasClicked = false;

//ignore: unawaited_futures
input.onClick.first.then((_) => wasClicked = true);
final Future<bool> wasClicked = input.onClick.first.then((_) => true);

final Future<List<XFile>> futureFile = domHelper.getFiles(
accept: accept,
multiple: multiple,
input: input,
);

expect(input.matches('body'), true);
expect(input.isConnected, true,
reason: 'input must be injected into the DOM');
expect(input.accept, accept);
expect(input.multiple, multiple);
expect(
wasClicked,
true,
reason:
'The <input /> should be clicked otherwise no dialog will be shown',
);
expect(await wasClicked, true,
reason:
'The <input /> should be clicked otherwise no dialog will be shown');

setFilesAndTriggerChange(<File>[]);
await futureFile;

// It should be already removed from the DOM after the file is resolved.
expect(input.parentElement, isNull);
expect(input.isConnected, isFalse);
});
});
});
Expand Down
6 changes: 3 additions & 3 deletions packages/file_selector/file_selector_web/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ name: file_selector_web_integration_tests
publish_to: none

environment:
sdk: ^3.1.0
flutter: ">=3.13.0"
sdk: ^3.3.0
flutter: ">=3.19.0"

dependencies:
file_selector_platform_interface: ^2.6.0
file_selector_web:
path: ../
flutter:
sdk: flutter
web: '>=0.3.0 <0.5.0'
web: ^0.5.0

dev_dependencies:
flutter_test:
Expand Down
11 changes: 4 additions & 7 deletions packages/file_selector/file_selector_web/lib/src/dom_helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ import 'package:web/helpers.dart';
class DomHelper {
/// Default constructor, initializes the container DOM element.
DomHelper() {
final Element body = querySelector('body')!;
final Element body = document.querySelector('body')!;
body.appendChild(_container);
}

final Element _container = createElementTag('file-selector');
final Element _container = document.createElement('file-selector');

/// Sets the <input /> attributes and waits for a file to be selected.
Future<List<XFile>> getFiles({
Expand All @@ -28,7 +28,7 @@ class DomHelper {
}) {
final Completer<List<XFile>> completer = Completer<List<XFile>>();
final HTMLInputElement inputElement =
input ?? (createElementTag('input') as HTMLInputElement)
input ?? (document.createElement('input') as HTMLInputElement)
..type = 'file';

_container.appendChild(
Expand Down Expand Up @@ -72,10 +72,7 @@ class DomHelper {
}

XFile _convertFileToXFile(File file) => XFile(
// TODO(srujzs): This is necessary in order to support package:web 0.4.0.
// This was not needed with 0.3.0, hence the lint.
// ignore: unnecessary_cast
URL.createObjectURL(file as JSObject),
URL.createObjectURL(file),
name: file.name,
length: file.size,
lastModified: DateTime.fromMillisecondsSinceEpoch(file.lastModified),
Expand Down
8 changes: 4 additions & 4 deletions packages/file_selector/file_selector_web/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: file_selector_web
description: Web platform implementation of file_selector
repository: https://github.com/flutter/packages/tree/main/packages/file_selector/file_selector_web
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+file_selector%22
version: 0.9.3
version: 0.9.4

environment:
sdk: ^3.2.0
flutter: ">=3.16.0"
sdk: ^3.3.0
flutter: ">=3.19.0"

flutter:
plugin:
Expand All @@ -22,7 +22,7 @@ dependencies:
sdk: flutter
flutter_web_plugins:
sdk: flutter
web: '>=0.3.0 <0.5.0'
web: ^0.5.0

dev_dependencies:
flutter_test:
Expand Down
5 changes: 5 additions & 0 deletions packages/google_identity_services_web/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.3.1

* Updates web code to package `web: ^0.5.0`.
* Updates SDK version to Dart `^3.3.0`. Flutter `^3.19.0`.

## 0.3.0+2

* Adds `fedcm_auto` to `CredentialSelectBy` enum.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,7 @@ void main() async {
expectConfigValue('login_uri', 'https://www.example.com/login');
expectConfigValue('native_callback', utils.isAJs('function'));
expectConfigValue('cancel_on_tap_outside', isFalse);
// TODO(srujzs): Remove once typed JSArrays (JSArray<T>) get to `stable`.
// ignore: always_specify_types
expectConfigValue('allowed_parent_origin', isA<JSArray>());
expectConfigValue('allowed_parent_origin', isA<JSArray<JSString>>());
expectConfigValue('prompt_parent_id', 'some_dom_id');
expectConfigValue('nonce', 's0m3_r4ndOM_vALu3');
expectConfigValue('context', 'signin');
Expand Down
3 changes: 1 addition & 2 deletions packages/google_identity_services_web/example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: google_identity_services_web_example
description: An example for the google_identity_services_web package, OneTap.
publish_to: 'none'
version: 0.0.1

environment:
flutter: ">=3.16.0"
Expand All @@ -13,7 +12,7 @@ dependencies:
google_identity_services_web:
path: ../
http: ">=0.13.0 <2.0.0"
web: ">=0.3.0 <0.5.0"
web: ^0.5.0

dev_dependencies:
build_runner: ^2.1.10 # To extract README excerpts only.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,7 @@ abstract class IdConfiguration {
JSString? context,
JSString? state_cookie_domain,
JSString? ux_mode,
// TODO(srujzs): Remove once typed JSArrays (JSArray<T>) get to `stable`.
// ignore: always_specify_types
JSArray? allowed_parent_origin,
JSArray<JSString>? allowed_parent_origin,
JSFunction? intermediate_iframe_close_callback,
JSBoolean? itp_support,
JSString? login_hint,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,75 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

/// Provides some useful tweaks to `package:web`.
library package_web_tweaks;

import 'dart:js_interop';

import 'package:web/web.dart' as web;

// TODO(kevmoo): Make this file unnecessary, https://github.com/dart-lang/web/issues/175

/// This extension gives web.window a nullable getter to the `trustedTypes`
/// property, which needs to be used to check for feature support.
extension NullableTrustedTypesGetter on web.Window {
/// (Nullable) Bindings to window.trustedTypes.
///
/// This may be null if the browser doesn't support the Trusted Types API.
///
/// See: https://developer.mozilla.org/en-US/docs/Web/API/Trusted_Types_API
@JS('trustedTypes')
external TrustedTypePolicyFactory? get nullableTrustedTypes;

/// Bindings to window.trustedTypes.
///
/// This will crash if accessed in a browser that doesn't support the
/// Trusted Types API.
///
/// See: https://developer.mozilla.org/en-US/docs/Web/API/Trusted_Types_API
@JS('trustedTypes')
external web.TrustedTypePolicyFactory? get nullableTrustedTypes;
external TrustedTypePolicyFactory get trustedTypes;
}

/// This extension allows a trusted type policy to create a script URL without
/// the `args` parameter (which in Chrome currently fails).
extension CreateScriptUrlWithoutArgs on web.TrustedTypePolicy {
/// This extension allows setting a TrustedScriptURL as the src of a script element,
/// which currently only accepts a string.
extension TrustedTypeSrcAttribute on web.HTMLScriptElement {
@JS('src')
external set trustedSrc(TrustedScriptURL value);
}

// TODO(kevmoo): drop all of this once `pkg:web` publishes `0.5.1`.

/// Bindings to a JS TrustedScriptURL.
///
/// See: https://developer.mozilla.org/en-US/docs/Web/API/TrustedScriptURL
extension type TrustedScriptURL._(JSObject _) implements JSObject {}

/// Bindings to a JS TrustedTypePolicyFactory.
///
/// See: https://developer.mozilla.org/en-US/docs/Web/API/TrustedTypePolicyFactory
extension type TrustedTypePolicyFactory._(JSObject _) implements JSObject {
///
external TrustedTypePolicy createPolicy(
String policyName, [
TrustedTypePolicyOptions policyOptions,
]);
}

/// Bindings to a JS TrustedTypePolicy.
///
/// See: https://developer.mozilla.org/en-US/docs/Web/API/TrustedTypePolicy
extension type TrustedTypePolicy._(JSObject _) implements JSObject {
///
@JS('createScriptURL')
external web.TrustedScriptURL createScriptURLNoArgs(
external TrustedScriptURL createScriptURLNoArgs(
String input,
);
}

/// This extension allows setting a TrustedScriptURL as the src of a script element,
/// which currently only accepts a string.
extension TrustedTypeSrcAttribute on web.HTMLScriptElement {
/// Bindings to a JS TrustedTypePolicyOptions (anonymous).
///
/// See: https://developer.mozilla.org/en-US/docs/Web/API/TrustedTypePolicyFactory/createPolicy#policyoptions
extension type TrustedTypePolicyOptions._(JSObject _) implements JSObject {
///
@JS('src')
external set srcTT(web.TrustedScriptURL value);
external factory TrustedTypePolicyOptions({
JSFunction createScriptURL,
});
}
8 changes: 4 additions & 4 deletions packages/google_identity_services_web/lib/src/js_loader.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ Future<void> loadWebSdk({
onGoogleLibraryLoad = () => completer.complete();

// If TrustedTypes are available, prepare a trusted URL.
web.TrustedScriptURL? trustedUrl;
TrustedScriptURL? trustedUrl;
if (web.window.nullableTrustedTypes != null) {
web.console.debug(
'TrustedTypes available. Creating policy: $trustedTypePolicyName'.toJS,
);
try {
final web.TrustedTypePolicy policy = web.window.trustedTypes.createPolicy(
final TrustedTypePolicy policy = web.window.trustedTypes.createPolicy(
trustedTypePolicyName,
web.TrustedTypePolicyOptions(
TrustedTypePolicyOptions(
createScriptURL: ((JSString url) => _url).toJS,
));
trustedUrl = policy.createScriptURLNoArgs(_url);
Expand All @@ -47,7 +47,7 @@ Future<void> loadWebSdk({
..async = true
..defer = true;
if (trustedUrl != null) {
script.srcTT = trustedUrl;
script.trustedSrc = trustedUrl;
} else {
script.src = _url;
}
Expand Down
Loading