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

Commit

Permalink
Add section about Material components
Browse files Browse the repository at this point in the history
  • Loading branch information
Emmanuel Garcia committed Feb 5, 2021
1 parent 37d658e commit b5f40de
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
4 changes: 4 additions & 0 deletions packages/webview_flutter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.0.0-nullsafety.5

* Add section to the wiki explaining how to use Material components.

## 2.0.0-nullsafety.4

* Update integration test to workaround an iOS 14 issue with `evaluateJavascript`.
Expand Down
24 changes: 22 additions & 2 deletions packages/webview_flutter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ You can now include a WebView widget in your widget tree. See the
[WebView](https://pub.dev/documentation/webview_flutter/latest/webview_flutter/WebView-class.html)
widget's Dartdoc for more details on how to use the widget.



## Android Platform Views
The WebView is relying on
[Platform Views](https://flutter.dev/docs/development/platform-integration/platform-views) to embed
Expand Down Expand Up @@ -68,3 +66,25 @@ android {
}
}
```

#### Enable Material Components for Android

To use Material Components when the user interacts with input elements in the WebView,
follow the steps described in the [Getting Started guide for Android](https://material.io/develop/android/docs/getting-started). For example:

1. Add the dependency on Android's Material in `<my-app>/android/app/build.gradle`:
```groovy
dependencies {
// ...
implementation 'com.google.android.material:material:<version>'
// ...
}
```

To find out the latest version, visit [Google Maven](https://maven.google.com/web/index.html#com.google.android.material:material).

2. Set the theme in `<my-app>/android/app/src/main/res/values/styles.xml`:
```diff
-<style name="LaunchTheme" parent="Theme.AppCompat">
+<style name="LaunchTheme" parent="Theme.MaterialComponents.NoActionBar">
```
2 changes: 1 addition & 1 deletion packages/webview_flutter/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: webview_flutter
description: A Flutter plugin that provides a WebView widget on Android and iOS.
version: 2.0.0-nullsafety.4
version: 2.0.0-nullsafety.5
homepage: https://github.com/flutter/plugins/tree/master/packages/webview_flutter

environment:
Expand Down

0 comments on commit b5f40de

Please sign in to comment.