Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

[webview_flutter] Add a backgroundColor option to the Android webview #4569

Merged
merged 7 commits into from Dec 6, 2021

Conversation

e-adrien
Copy link
Contributor

@e-adrien e-adrien commented Dec 3, 2021

This PR add an option to set the background color of the Android webview.

Original PR :

#3431

It fixes this issue :

flutter/flutter#29300

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the relevant style guides and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/plugins repo does use dart format.)
  • I signed the CLA.
  • The title of the PR starts with the name of the plugin surrounded by square brackets, e.g. [shared_preferences]
  • I listed at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.
  • I updated CHANGELOG.md to add a description of the change, following repository CHANGELOG style.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@google-cla google-cla bot added the cla: yes label Dec 3, 2021
@github-actions github-actions bot added p: webview_flutter Edits files for a webview_flutter plugin platform-android labels Dec 3, 2021
Copy link
Contributor

@stuartmorgan stuartmorgan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nits, and this needs the auto-formatter run so CI passes.

@bparrishMines or @mvanbeusekom for secondary review.

WebViewController controller, BuildContext context) async {
final String contentBase64 =
base64Encode(const Utf8Encoder().convert(kTransparentBackgroundPage));
await controller.loadUrl('data:text/html;base64,$contentBase64');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: As with the iOS review, this can use loadHtmlString now.

@e-adrien
Copy link
Contributor Author

e-adrien commented Dec 4, 2021

I made the changes. I also hard code the Colors.green color in the example as jmagman requested it in the iOS PR.

@stuartmorgan stuartmorgan mentioned this pull request Dec 4, 2021
Copy link
Contributor

@stuartmorgan stuartmorgan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

I made a dummy PR at #4579 to run the new test in CI just to make sure it's working there.

Copy link
Contributor

@mvanbeusekom mvanbeusekom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with one small nit

@stuartmorgan
Copy link
Contributor

I've filed an issue tracking the FTL problem, and temporarily disabled the integration test.

@stuartmorgan stuartmorgan merged commit 5012b95 into flutter:master Dec 6, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 6, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 6, 2021
amantoux pushed a commit to amantoux/plugins that referenced this pull request Dec 11, 2021
…flutter#4569)

This PR add an option to set the background color of the Android webview.

Part of: flutter#3431
Part of: flutter/flutter#29300
KyleFin pushed a commit to KyleFin/plugins that referenced this pull request Dec 21, 2021
…flutter#4569)

This PR add an option to set the background color of the Android webview.

Part of: flutter#3431
Part of: flutter/flutter#29300
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes p: webview_flutter Edits files for a webview_flutter plugin platform-android
Projects
None yet
3 participants