Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
517e9d4
Implement http basic auth
JeroenWeener Aug 10, 2023
967879b
Apply feedback
JeroenWeener Aug 28, 2023
c8624c0
Create HttpAuthHandlerTest.java
JeroenWeener Aug 29, 2023
4f3574d
Format java files
JeroenWeener Aug 29, 2023
1e7f785
Regenerate build_runner files
JeroenWeener Aug 29, 2023
131bc56
Implement feedback
JeroenWeener Sep 11, 2023
bc01be4
Remove redundant key in `Info.plist`
JeroenWeener Sep 11, 2023
67aa00e
Update example apps
JeroenWeener Sep 11, 2023
32496d0
Implement http basic auth
JeroenWeener Aug 10, 2023
aeb8708
Apply feedback
JeroenWeener Aug 28, 2023
fffc4c7
Create HttpAuthHandlerTest.java
JeroenWeener Aug 29, 2023
b455040
Format java files
JeroenWeener Aug 29, 2023
2aa9bfe
Regenerate build_runner files
JeroenWeener Aug 29, 2023
db286ba
Implement feedback
JeroenWeener Sep 11, 2023
467feb3
Remove redundant key in `Info.plist`
JeroenWeener Sep 11, 2023
dad8ae6
Update example apps
JeroenWeener Sep 11, 2023
6f3d802
Merge branch 'webview-auth-request' of https://github.com/andreisas06…
JeroenWeener Nov 1, 2023
0fef591
Add platform interface dev dependency to example
JeroenWeener Nov 1, 2023
b2a4fbb
Merge branch 'main' into webview-auth-request
JeroenWeener Nov 1, 2023
ce35d9b
Update packages/webview_flutter/webview_flutter_platform_interface/li…
bparrishMines Nov 8, 2023
fc32898
Merge branch 'main' of github.com:flutter/packages into webview-auth-…
bparrishMines Nov 8, 2023
4673e65
Merge branch 'webview-auth-request' of github.com:andreisas06/package…
bparrishMines Nov 8, 2023
580521a
Fix some lints, errros and call on errors
bparrishMines Nov 8, 2023
d1f305b
fix lints
bparrishMines Nov 8, 2023
a3f74be
fix tests
bparrishMines Nov 8, 2023
ed3798f
add onProceed and onCancel back
bparrishMines Nov 8, 2023
154c1f8
dont require realm to be nonnull
bparrishMines Nov 8, 2023
3c61dbc
add line back
bparrishMines Nov 8, 2023
7cf0d7e
Merge remote-tracking branch 'upstream/main' into webview-auth-request
JeroenWeener Nov 21, 2023
a21f29a
Update changelogs
JeroenWeener Nov 21, 2023
b109620
Bump dependencies
JeroenWeener Dec 20, 2023
4af593b
Merge remote-tracking branch 'upstream/main' into webview-auth-reques…
JeroenWeener Dec 20, 2023
a578a91
Remove unrelevant changes
JeroenWeener Dec 20, 2023
4b87383
Remove dependency overrides
JeroenWeener Dec 20, 2023
51ebcb3
Merge branch 'main' of github.com:flutter/packages into webview-auth-…
bparrishMines Jan 22, 2024
88f021b
rename test file
bparrishMines Jan 22, 2024
17ea559
fix pubspec and add docs
bparrishMines Jan 22, 2024
dfba830
formatting
bparrishMines Jan 22, 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
Update example apps
  • Loading branch information
JeroenWeener committed Oct 26, 2023
commit 67aa00e85dec9450082b535f8238521151b140c9
37 changes: 31 additions & 6 deletions packages/webview_flutter/webview_flutter/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,6 @@ Page resource error:
debugPrint('url change to ${change.url}');
},
onHttpAuthRequest: (HttpAuthRequest request) {
debugPrint(
'HTTP basic auth request with host ${request.host} and realm ${request.realm ?? '-'}');
openDialog(request);
},
),
Expand Down Expand Up @@ -364,7 +362,7 @@ class SampleMenu extends StatelessWidget {
_onLogExample();
break;
case MenuOptions.basicAuthentication:
_basicAuthExample();
_promptForUrl(context);
break;
}
},
Expand Down Expand Up @@ -584,9 +582,36 @@ class SampleMenu extends StatelessWidget {
return webViewController.loadHtmlString(kLogExamplePage);
}

Future<void> _basicAuthExample() {
return webViewController.loadRequest(Uri.parse(
'https://www.httpwatch.com/httpgallery/authentication/#showExample10'));
Future<void> _promptForUrl(BuildContext context) {
final TextEditingController urlTextController = TextEditingController();

return showDialog<String>(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: const Text('Input URL to visit'),
content: TextField(
decoration: const InputDecoration(labelText: 'URL'),
autofocus: true,
controller: urlTextController,
),
actions: <Widget>[
TextButton(
onPressed: () {
if (urlTextController.text.isNotEmpty) {
final Uri? uri = Uri.tryParse(urlTextController.text);
if (uri != null && uri.scheme.isNotEmpty) {
webViewController.loadRequest(uri);
Navigator.pop(context);
}
}
},
child: const Text('Visit'),
),
],
);
},
);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ class SampleMenu extends StatelessWidget {
_onLogExample();
break;
case MenuOptions.basicAuthentication:
_basicAuthExample();
_promptForUrl(context);
break;
}
},
Expand Down Expand Up @@ -606,10 +606,38 @@ class SampleMenu extends StatelessWidget {
return webViewController.loadHtmlString(kLogExamplePage);
}

Future<void> _basicAuthExample() {
return webViewController.loadRequest(LoadRequestParams(
uri: Uri.parse(
'https://www.httpwatch.com/httpgallery/authentication/#showExample10')));
Future<void> _promptForUrl(BuildContext context) {
final TextEditingController urlTextController = TextEditingController();

return showDialog<String>(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: const Text('Input URL to visit'),
content: TextField(
decoration: const InputDecoration(labelText: 'URL'),
autofocus: true,
controller: urlTextController,
),
actions: <Widget>[
TextButton(
onPressed: () {
if (urlTextController.text.isNotEmpty) {
final Uri? uri = Uri.tryParse(urlTextController.text);
if (uri != null && uri.scheme.isNotEmpty) {
webViewController.loadRequest(
LoadRequestParams(uri: uri),
);
Navigator.pop(context);
}
}
},
child: const Text('Visit'),
),
],
);
},
);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
Expand All @@ -24,16 +22,6 @@
<string>$(FLUTTER_BUILD_NUMBER)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoadsInWebContent</key>
<true/>
</dict>
<key>NSCameraUsageDescription</key>
<string>If you want to use the camera, you have to give permission.</string>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
<array/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
Expand All @@ -51,5 +39,16 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
<key>NSCameraUsageDescription</key>
<string>If you want to use the camera, you have to give permission.</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoadsInWebContent</key>
<true/>
</dict>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,6 @@ Page resource error:
debugPrint('url change to ${change.url}');
})
..setOnHttpAuthRequest((HttpAuthRequest request) {
debugPrint(
'HTTP basic auth request with host ${request.host} and realm ${request.realm ?? '-'}');
openDialog(request);
}),
)
Expand Down Expand Up @@ -363,7 +361,7 @@ class SampleMenu extends StatelessWidget {
_onLogExample();
break;
case MenuOptions.basicAuthentication:
_basicAuthExample();
_promptForUrl(context);
break;
}
},
Expand Down Expand Up @@ -588,10 +586,39 @@ class SampleMenu extends StatelessWidget {
return webViewController.loadHtmlString(kLogExamplePage);
}

Future<void> _basicAuthExample() {
return webViewController.loadRequest(LoadRequestParams(
uri: Uri.parse(
'https://www.httpwatch.com/httpgallery/authentication/#showExample10')));
Future<void> _promptForUrl(BuildContext context) {
final TextEditingController urlTextController =
TextEditingController(text: 'https://');

return showDialog<String>(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: const Text('Input URL to visit'),
content: TextField(
decoration: const InputDecoration(labelText: 'URL'),
autofocus: true,
controller: urlTextController,
),
actions: <Widget>[
TextButton(
onPressed: () {
if (urlTextController.text.isNotEmpty) {
final Uri? uri = Uri.tryParse(urlTextController.text);
if (uri != null && uri.scheme.isNotEmpty) {
webViewController.loadRequest(
LoadRequestParams(uri: uri),
);
Navigator.pop(context);
}
}
},
child: const Text('Visit'),
),
],
);
},
);
}
}

Expand Down