Skip to content

Commit

Permalink
[webview_flutter] Pre-emptively ignore prefer_const_constructor warni…
Browse files Browse the repository at this point in the history
…ng. (flutter#4550)
  • Loading branch information
mvanbeusekom authored Nov 28, 2021
1 parent 23da6d0 commit 6951822
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,8 @@ class WebViewController {
bool? hasNavigationDelegate;
bool? hasProgressTracking;
bool? debuggingEnabled;
// TODO(mvanbeusekom): Cleanup and convert to const constructor when platform_interface is fixed (see https://github.com/flutter/flutter/issues/94311)
// ignore: prefer_const_constructors
WebSetting<String?> userAgent = WebSetting<String?>.absent();
bool? zoomEnabled;
if (currentValue.javascriptMode != newValue.javascriptMode) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ void main() {
creationParams: creationParams ??
CreationParams(
webSettings: WebSettings(
// TODO(mvanbeusekom): Cleanup and convert to const constructor when platform_interface is fixed (see https://github.com/flutter/flutter/issues/94311)
// ignore: prefer_const_constructors
userAgent: WebSetting<String?>.absent(),
hasNavigationDelegate: hasNavigationDelegate,
hasProgressTracking: hasProgressTracking,
Expand Down Expand Up @@ -121,6 +123,8 @@ void main() {
creationParams: CreationParams(
initialUrl: 'https://www.google.com',
webSettings: WebSettings(
// TODO(mvanbeusekom): Cleanup and convert to const constructor when platform_interface is fixed (see https://github.com/flutter/flutter/issues/94311)
// ignore: prefer_const_constructors
userAgent: WebSetting<String?>.absent(),
hasNavigationDelegate: false,
),
Expand All @@ -138,6 +142,8 @@ void main() {
creationParams: CreationParams(
userAgent: 'MyUserAgent',
webSettings: WebSettings(
// TODO(mvanbeusekom): Cleanup and convert to const constructor when platform_interface is fixed (see https://github.com/flutter/flutter/issues/94311)
// ignore: prefer_const_constructors
userAgent: WebSetting<String?>.absent(),
hasNavigationDelegate: false,
),
Expand All @@ -154,6 +160,8 @@ void main() {
autoMediaPlaybackPolicy:
AutoMediaPlaybackPolicy.require_user_action_for_all_media_types,
webSettings: WebSettings(
// TODO(mvanbeusekom): Cleanup and convert to const constructor when platform_interface is fixed (see https://github.com/flutter/flutter/issues/94311)
// ignore: prefer_const_constructors
userAgent: WebSetting<String?>.absent(),
hasNavigationDelegate: false,
),
Expand All @@ -169,6 +177,8 @@ void main() {
creationParams: CreationParams(
autoMediaPlaybackPolicy: AutoMediaPlaybackPolicy.always_allow,
webSettings: WebSettings(
// TODO(mvanbeusekom): Cleanup and convert to const constructor when platform_interface is fixed (see https://github.com/flutter/flutter/issues/94311)
// ignore: prefer_const_constructors
userAgent: WebSetting<String?>.absent(),
hasNavigationDelegate: false,
),
Expand All @@ -184,6 +194,8 @@ void main() {
creationParams: CreationParams(
javascriptChannelNames: <String>{'a', 'b'},
webSettings: WebSettings(
// TODO(mvanbeusekom): Cleanup and convert to const constructor when platform_interface is fixed (see https://github.com/flutter/flutter/issues/94311)
// ignore: prefer_const_constructors
userAgent: WebSetting<String?>.absent(),
hasNavigationDelegate: false,
),
Expand All @@ -202,6 +214,8 @@ void main() {
tester,
creationParams: CreationParams(
webSettings: WebSettings(
// TODO(mvanbeusekom): Cleanup and convert to const constructor when platform_interface is fixed (see https://github.com/flutter/flutter/issues/94311)
// ignore: prefer_const_constructors
userAgent: WebSetting<String?>.absent(),
javascriptMode: JavascriptMode.unrestricted,
hasNavigationDelegate: false,
Expand All @@ -217,6 +231,8 @@ void main() {
tester,
creationParams: CreationParams(
webSettings: WebSettings(
// TODO(mvanbeusekom): Cleanup and convert to const constructor when platform_interface is fixed (see https://github.com/flutter/flutter/issues/94311)
// ignore: prefer_const_constructors
userAgent: WebSetting<String?>.absent(),
hasNavigationDelegate: true,
),
Expand All @@ -232,6 +248,8 @@ void main() {
tester,
creationParams: CreationParams(
webSettings: WebSettings(
// TODO(mvanbeusekom): Cleanup and convert to const constructor when platform_interface is fixed (see https://github.com/flutter/flutter/issues/94311)
// ignore: prefer_const_constructors
userAgent: WebSetting<String?>.absent(),
debuggingEnabled: true,
hasNavigationDelegate: false,
Expand All @@ -247,6 +265,8 @@ void main() {
tester,
creationParams: CreationParams(
webSettings: WebSettings(
// TODO(mvanbeusekom): Cleanup and convert to const constructor when platform_interface is fixed (see https://github.com/flutter/flutter/issues/94311)
// ignore: prefer_const_constructors
userAgent: WebSetting<String?>.of('myUserAgent'),
hasNavigationDelegate: false,
),
Expand All @@ -261,6 +281,8 @@ void main() {
tester,
creationParams: CreationParams(
webSettings: WebSettings(
// TODO(mvanbeusekom): Cleanup and convert to const constructor when platform_interface is fixed (see https://github.com/flutter/flutter/issues/94311)
// ignore: prefer_const_constructors
userAgent: WebSetting<String?>.absent(),
zoomEnabled: false,
hasNavigationDelegate: false,
Expand Down

0 comments on commit 6951822

Please sign in to comment.