-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #110 from naoki0719/fix/changelogs
Update to flutter 3.22.0 and version 9.0.2
- Loading branch information
Showing
114 changed files
with
3,557 additions
and
584 deletions.
There are no files selected for viewing
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,4 @@ | ||
{ | ||
"flutter": "3.22.0", | ||
"flavors": {} | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,139 +1,16 @@ | ||
# Flutter Screen Lock | ||
# example | ||
|
||
This Flutter plugin provides an feature for screen lock. | ||
Enter your passcode to unlock the screen. | ||
You can also use biometric authentication as an option. | ||
A new Flutter project. | ||
|
||
<img src="https://raw.githubusercontent.com/naoki0719/flutter_screen_lock/master/resources/flutter_screen_lock_v3.gif" /> | ||
## Getting Started | ||
|
||
## Features | ||
This project is a starting point for a Flutter application. | ||
|
||
- By the length of the character count | ||
- You can change `Cancel` and `Delete` widget | ||
- Optimizes the UI for device size and orientation | ||
- You can disable cancellation | ||
- You can use biometrics (local_auth plugin) | ||
- Biometrics can be displayed on first launch | ||
- Unlocked callback | ||
- You can specify a mismatch event. | ||
- Limit the maximum number of retries | ||
A few resources to get you started if this is your first Flutter project: | ||
|
||
## Usage | ||
- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) | ||
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) | ||
|
||
You can easily lock the screen with the following code. | ||
To unlock, enter correctString. | ||
|
||
### Simple | ||
|
||
If the passcode the user entered matches, `onUnlocked` is called. | ||
|
||
```dart | ||
import 'package:flutter_screen_lock/flutter_screen_lock.dart'; | ||
showLockScreen( | ||
context: context, | ||
correctString: '1234', | ||
onUnlocked: () => print('Unlocked.'), | ||
); | ||
``` | ||
|
||
### Change digits | ||
|
||
Digits will be adjusted to the length of `correctString`. | ||
|
||
```dart | ||
import 'package:flutter_screen_lock/flutter_screen_lock.dart'; | ||
lockScreen( | ||
context: context, | ||
correctString: '123456', | ||
); | ||
``` | ||
|
||
When creating a PIN, you can specify the amount: | ||
|
||
```dart | ||
import 'package:flutter_screen_lock/flutter_screen_lock.dart'; | ||
lockScreenCreate( | ||
context: context, | ||
digits: 6, | ||
onConfirmed: (value) => print(value), | ||
); | ||
``` | ||
|
||
|
||
### Use local_auth | ||
|
||
Add the [local_auth](https://pub.dev/packages/local_auth) package to pubspec.yml. | ||
|
||
It includes an example that calls biometrics as soon as screenLock is displayed in `didOpened`. | ||
|
||
```dart | ||
import 'package:flutter_screen_lock/flutter_screen_lock.dart'; | ||
import 'package:local_auth/local_auth.dart'; | ||
import 'package:flutter/material.dart'; | ||
Future<void> localAuth(BuildContext context) async { | ||
final localAuth = LocalAuthentication(); | ||
final didAuthenticate = await localAuth.authenticateWithBiometrics( | ||
localizedReason: 'Please authenticate'); | ||
if (didAuthenticate) { | ||
Navigator.pop(context); | ||
} | ||
} | ||
screenLock( | ||
context: context, | ||
correctString: '1234', | ||
customizedButtonChild: Icon(Icons.fingerprint), | ||
customizedButtonTap: () async => await localAuth(context), | ||
didOpened: () async => await localAuth(context), | ||
); | ||
``` | ||
|
||
### Block user | ||
|
||
This is the case where you want to force authentication when the app is first launched. | ||
|
||
```dart | ||
lockScreen( | ||
context: context, | ||
correctString: '1234', | ||
canCancel: false, | ||
); | ||
``` | ||
|
||
### Customize text | ||
|
||
You can change `Cancel` and `Delete` text. | ||
|
||
```dart | ||
showLockScreen( | ||
context: context, | ||
correctString: '1234', | ||
cancelButton: Text('Close'), | ||
deleteButton: Text('Remove'), | ||
); | ||
``` | ||
|
||
### User creating new passcode | ||
|
||
Will let user enter a new passcode and confirm it. | ||
|
||
You have to store the passcode somewhere manually. | ||
|
||
```dart | ||
import 'package:flutter_screen_lock/flutter_screen_lock.dart'; | ||
screenLockCreate( | ||
context: context, | ||
onConfirmed: (value) => print(value), // store new passcode somewhere here | ||
); | ||
``` | ||
|
||
## FAQ | ||
|
||
### How to prevent the background from being transparent | ||
|
||
Set the `backgroundColorOpacity` option to 1 | ||
For help getting started with Flutter development, view the | ||
[online documentation](https://docs.flutter.dev/), which offers tutorials, | ||
samples, guidance on mobile development, and a full API reference. |
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 |
---|---|---|
@@ -1,5 +1,28 @@ | ||
# This file configures the analyzer, which statically analyzes Dart code to | ||
# check for errors, warnings, and lints. | ||
# | ||
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled | ||
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be | ||
# invoked from the command line by running `flutter analyze`. | ||
|
||
# The following line activates a set of recommended lints for Flutter apps, | ||
# packages, and plugins designed to encourage good coding practices. | ||
include: package:flutter_lints/flutter.yaml | ||
|
||
analyzer: | ||
linter: | ||
# The lint rules applied to this project can be customized in the | ||
# section below to disable rules from the `package:flutter_lints/flutter.yaml` | ||
# included above or to enable additional rules. A list of all available lints | ||
# and their documentation is published at https://dart.dev/lints. | ||
# | ||
# Instead of disabling a lint rule for the entire project in the | ||
# section below, it can also be suppressed for a single line of code | ||
# or a specific dart file by using the `// ignore: name_of_lint` and | ||
# `// ignore_for_file: name_of_lint` syntax on the line or in the file | ||
# producing the lint. | ||
rules: | ||
# avoid_print: false # Uncomment to disable the `avoid_print` rule | ||
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule | ||
|
||
# Additional information about this file can be found at | ||
# https://dart.dev/guides/language/analysis-options |
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,63 +1,58 @@ | ||
plugins { | ||
id "com.android.application" | ||
id "kotlin-android" | ||
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. | ||
id "dev.flutter.flutter-gradle-plugin" | ||
} | ||
|
||
def localProperties = new Properties() | ||
def localPropertiesFile = rootProject.file('local.properties') | ||
def localPropertiesFile = rootProject.file("local.properties") | ||
if (localPropertiesFile.exists()) { | ||
localPropertiesFile.withReader('UTF-8') { reader -> | ||
localPropertiesFile.withReader("UTF-8") { reader -> | ||
localProperties.load(reader) | ||
} | ||
} | ||
|
||
def flutterRoot = localProperties.getProperty('flutter.sdk') | ||
if (flutterRoot == null) { | ||
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") | ||
} | ||
|
||
def flutterVersionCode = localProperties.getProperty('flutter.versionCode') | ||
def flutterVersionCode = localProperties.getProperty("flutter.versionCode") | ||
if (flutterVersionCode == null) { | ||
flutterVersionCode = '1' | ||
flutterVersionCode = "1" | ||
} | ||
|
||
def flutterVersionName = localProperties.getProperty('flutter.versionName') | ||
def flutterVersionName = localProperties.getProperty("flutter.versionName") | ||
if (flutterVersionName == null) { | ||
flutterVersionName = '1.0' | ||
flutterVersionName = "1.0" | ||
} | ||
|
||
apply plugin: 'com.android.application' | ||
apply plugin: 'kotlin-android' | ||
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" | ||
|
||
android { | ||
compileSdkVersion 31 | ||
namespace = "com.example.example" | ||
compileSdk = flutter.compileSdkVersion | ||
ndkVersion = flutter.ndkVersion | ||
|
||
sourceSets { | ||
main.java.srcDirs += 'src/main/kotlin' | ||
} | ||
|
||
lintOptions { | ||
disable 'InvalidPackage' | ||
compileOptions { | ||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
targetCompatibility = JavaVersion.VERSION_1_8 | ||
} | ||
|
||
defaultConfig { | ||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). | ||
applicationId "com.example.example" | ||
minSdkVersion 16 | ||
targetSdkVersion 28 | ||
versionCode flutterVersionCode.toInteger() | ||
versionName flutterVersionName | ||
applicationId = "com.example.example" | ||
// You can update the following values to match your application needs. | ||
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. | ||
minSdk = flutter.minSdkVersion | ||
targetSdk = flutter.targetSdkVersion | ||
versionCode = flutterVersionCode.toInteger() | ||
versionName = flutterVersionName | ||
} | ||
|
||
buildTypes { | ||
release { | ||
// TODO: Add your own signing config for the release build. | ||
// Signing with the debug keys for now, so `flutter run --release` works. | ||
signingConfig signingConfigs.debug | ||
signingConfig = signingConfigs.debug | ||
} | ||
} | ||
} | ||
|
||
flutter { | ||
source '../..' | ||
} | ||
|
||
dependencies { | ||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" | ||
source = "../.." | ||
} |
Oops, something went wrong.