screen_protection 0.0.7 copy "screen_protection: ^0.0.7" to clipboard
screen_protection: ^0.0.7 copied to clipboard

The problem we identified is the need for enhanced security in our app. Many users store sensitive information within the app, making it crucial to protect their data from unauthorized access. Our sol [...]

Protection screen #

Flutter Version

Dart Version

The problem we identified is the need for enhanced security in our app. Many users store sensitive information within the app, making it crucial to protect their data from unauthorized access. Our solution is to implement a protection screen that will act as a barrier to the app's content, requiring authentication before granting access.

Features #

This plugin provides you 3 different methods to add protection to your app

  • PIN
  • Pattern
  • Fingerprint

with high preferable customization

Demo #











## How to Use 1- Go to `android/app/src/main/AndroidManifest.xml`

Add the following line to the AndroidManifest.xml file:

<uses-permission android:name="android.permission.USE_FINGERPRINT"/>
  • this tag is used to declare permissions that your Android application requires to access certain features or resources on the device

2- Go to android/app/src/main/kotlin/MainActivity.kt

replace the MainActivity.kt file with :

package com.example."the name of your project "
import androidx.annotation.NonNull;
import io.flutter.embedding.android.FlutterFragmentActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugins.GeneratedPluginRegistrant

class MainActivity: FlutterFragmentActivity() {
    override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
        GeneratedPluginRegistrant.registerWith(flutterEngine);
    }
}
  • This setup allows you to create a hybrid app with both native Android components and Flutter UI seamlessly integrated.

  • make you main async (start the main with two line):

WidgetsFlutterBinding.ensureInitialized();
await initialize();

3- Go to android/app/bulid.gradle file add to the defaultConfig this two lines

multiDexEnabled true
minSdkVersion 21
  • inside runApp call Protector and pass your Application entry point as a child to this class.

  • to clear the saved authentication data call

clear()

4- the usage :

  • pattern : to give the user the accessability to

choose pattern method (true by default) (bool)

  • pin : to give the user the accessability to choose

pin method (true by default) (bool)

  • fingerprint : to give the user the accessability to

choose fingerprint method (true by default) (bool)

  • appBar : pass your AppBar to override the default

one (AppBar)

  • backgroundColor : change the background color of the

main screen (black by default) (Color)

  • mainTitle : change the main title in the main screen

('Choose your security method' by default) (Text)

  • mainButtonStyle : change how the button in the main

screen looks like (no need to make it clickable) (Widget)

  • fingerprintBackgroundColor: change the background

color of the fingerprint screen (grey by default) (Color)

  • patternBackgroundColor: change the background color

of the pattern screen (black by default) (Color)

  • pinBackgroundColor: change the background color of

the pin screen (grey by default) (Color)

  • patternDimension: change the dimension of the pattern

in the pattern screen (3 by default) (int)

License #

This project is licensed under the MIT License - see the LICENSE file for details.

Authors :

  • Ammar Meslmani .
  • Saleem Asekrea .
4
likes
70
pub points
30%
popularity

Publisher

unverified uploader

The problem we identified is the need for enhanced security in our app. Many users store sensitive information within the app, making it crucial to protect their data from unauthorized access. Our solution is to implement a protection screen that will act as a barrier to the app's content, requiring authentication before granting access

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter, hive_flutter, local_auth, plugin_platform_interface

More

Packages that depend on screen_protection