From 82b42a5e5ffe7367f4602d910f4bd87c1f3ff8fa Mon Sep 17 00:00:00 2001
From: Abel1027 <64153497+Abel1027@users.noreply.github.com>
Date: Tue, 21 Feb 2023 17:14:53 +0100
Subject: [PATCH] [local_auth] Add Android theme compatibility documentation
(#6875)
Add documentation to README.md file from local_auth package:
- Compatibility of Android theme for Android 8 and below.
---
packages/local_auth/local_auth/CHANGELOG.md | 3 +-
packages/local_auth/local_auth/README.md | 36 +++++++++++++++++++++
packages/local_auth/local_auth/pubspec.yaml | 2 +-
3 files changed, 39 insertions(+), 2 deletions(-)
diff --git a/packages/local_auth/local_auth/CHANGELOG.md b/packages/local_auth/local_auth/CHANGELOG.md
index d5ad7aa9a2..0028704b34 100644
--- a/packages/local_auth/local_auth/CHANGELOG.md
+++ b/packages/local_auth/local_auth/CHANGELOG.md
@@ -1,6 +1,7 @@
-## NEXT
+## 2.1.4
* Updates minimum Flutter version to 3.0.
+* Updates documentation for Android version 8 and below theme compatibility.
## 2.1.3
diff --git a/packages/local_auth/local_auth/README.md b/packages/local_auth/local_auth/README.md
index a68692ea94..8abf583b9d 100644
--- a/packages/local_auth/local_auth/README.md
+++ b/packages/local_auth/local_auth/README.md
@@ -252,6 +252,42 @@ types (such as face scanning) and you want to support SDKs lower than Q,
_do not_ call `getAvailableBiometrics`. Simply call `authenticate` with `biometricOnly: true`.
This will return an error if there was no hardware available.
+#### Android theme
+
+Your `LaunchTheme`'s parent must be a valid `Theme.AppCompat` theme to prevent
+crashes on Android 8 and below. For example, use `Theme.AppCompat.DayNight` to
+enable light/dark modes for the biometric dialog. To do that go to
+`android/app/src/main/res/values/styles.xml` and look for the style with name
+`LaunchTheme`. Then change the parent for that style as follows:
+
+```xml
+...
+
+
+ ...
+
+...
+```
+
+If you don't have a `styles.xml` file for your Android project you can set up
+the Android theme directly in `android/app/src/main/AndroidManifest.xml`:
+
+```xml
+...
+
+
+
+...
+```
+
## Sticky Auth
You can set the `stickyAuth` option on the plugin to true so that plugin does not
diff --git a/packages/local_auth/local_auth/pubspec.yaml b/packages/local_auth/local_auth/pubspec.yaml
index 769de34b2b..c2d3a007d1 100644
--- a/packages/local_auth/local_auth/pubspec.yaml
+++ b/packages/local_auth/local_auth/pubspec.yaml
@@ -3,7 +3,7 @@ description: Flutter plugin for Android and iOS devices to allow local
authentication via fingerprint, touch ID, face ID, passcode, pin, or pattern.
repository: https://github.com/flutter/plugins/tree/main/packages/local_auth/local_auth
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+local_auth%22
-version: 2.1.3
+version: 2.1.4
environment:
sdk: ">=2.14.0 <3.0.0"