-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[url_launcher] Add
InAppBrowserConfiguration
parameter (#5758)
This is #5166 portion of platform interface changes. Adds `InAppBrowserConfiguration` parameter, as well as `InAppBrowserConfiguration.showTitle` parameter that configures whether to show or not to show webpage title
- Loading branch information
1 parent
31fc7b5
commit 7beab0d
Showing
5 changed files
with
65 additions
and
1 deletion.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
packages/url_launcher/url_launcher_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
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
16 changes: 16 additions & 0 deletions
16
.../url_launcher/url_launcher_platform_interface/test/in_app_browser_configuration_test.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,16 @@ | ||
// 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_test/flutter_test.dart'; | ||
import 'package:url_launcher_platform_interface/url_launcher_platform_interface.dart'; | ||
|
||
void main() { | ||
test('InAppBrowserConfiguration defaults to showTitle false', () { | ||
expect(const InAppBrowserConfiguration().showTitle, false); | ||
}); | ||
|
||
test('InAppBrowserConfiguration showTitle can be set to true', () { | ||
expect(const InAppBrowserConfiguration(showTitle: true).showTitle, true); | ||
}); | ||
} |
28 changes: 28 additions & 0 deletions
28
packages/url_launcher/url_launcher_platform_interface/test/launch_options_test.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,28 @@ | ||
// 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_test/flutter_test.dart'; | ||
import 'package:url_launcher_platform_interface/url_launcher_platform_interface.dart'; | ||
|
||
void main() { | ||
test('LaunchOptions have default InAppBrowserConfiguration when not passed', | ||
() { | ||
expect( | ||
const LaunchOptions().browserConfiguration, | ||
const InAppBrowserConfiguration(), | ||
); | ||
}); | ||
|
||
test('passing non-default InAppBrowserConfiguration to LaunchOptions works', | ||
() { | ||
const InAppBrowserConfiguration browserConfiguration = | ||
InAppBrowserConfiguration(showTitle: true); | ||
|
||
const LaunchOptions launchOptions = LaunchOptions( | ||
browserConfiguration: browserConfiguration, | ||
); | ||
|
||
expect(launchOptions.browserConfiguration, browserConfiguration); | ||
}); | ||
} |