forked from flutter/packages
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[webview_flutter] Implement platform interface for JavaScript dialog (f…
…lutter#5670) Adds the platform interface implementation for JavaScript dailog. This PR is part of a series of PRs that aim to close flutter/flutter#30358 (comment) The PR that contains all changes can be found at flutter#4704
- Loading branch information
Showing
6 changed files
with
136 additions
and
1 deletion.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
packages/webview_flutter/webview_flutter_platform_interface/CHANGELOG.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
...w_flutter/webview_flutter_platform_interface/lib/src/types/javascript_dialog_request.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
import 'package:flutter/foundation.dart'; | ||
|
||
/// Defines the parameters that support `PlatformWebViewController.setOnJavaScriptAlertDialog`. | ||
@immutable | ||
class JavaScriptAlertDialogRequest { | ||
/// Creates a [JavaScriptAlertDialogRequest]. | ||
const JavaScriptAlertDialogRequest({ | ||
required this.message, | ||
required this.url, | ||
}); | ||
|
||
/// The message to be displayed in the window. | ||
final String message; | ||
|
||
/// The URL of the page requesting the dialog. | ||
final String url; | ||
} | ||
|
||
/// Defines the parameters that support `PlatformWebViewController.setOnJavaScriptConfirmDialog`. | ||
@immutable | ||
class JavaScriptConfirmDialogRequest { | ||
/// Creates a [JavaScriptConfirmDialogRequest]. | ||
const JavaScriptConfirmDialogRequest({ | ||
required this.message, | ||
required this.url, | ||
}); | ||
|
||
/// The message to be displayed in the window. | ||
final String message; | ||
|
||
/// The URL of the page requesting the dialog. | ||
final String url; | ||
} | ||
|
||
/// Defines the parameters that support `PlatformWebViewController.setOnJavaScriptTextInputDialog`. | ||
@immutable | ||
class JavaScriptTextInputDialogRequest { | ||
/// Creates a [JavaScriptAlertDialogRequest]. | ||
const JavaScriptTextInputDialogRequest({ | ||
required this.message, | ||
required this.url, | ||
required this.defaultText, | ||
}); | ||
|
||
/// The message to be displayed in the window. | ||
final String message; | ||
|
||
/// The URL of the page requesting the dialog. | ||
final String url; | ||
|
||
/// The initial text to display in the text entry field. | ||
final String? defaultText; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters