Showing posts with label flutter. Show all posts
Showing posts with label flutter. Show all posts

November 26, 2021

Flutter Local (Inbuilt) Authentication usage

Hi folks,

Today I will explain the process of using local (in-built) authentication usage in Flutter.

Pre-requisites

1. pubspeck.yaml update
dependencies:
      local_auth: ^0.6.2+3
2. Install the packages from command line
    $ flutter pub get
    Note: In Visual Studio Code or Android Studio automatically by saving the pubspec.yaml file packages will get updated

Usage

1. Import the package in the respective dart file (say main.dart)
    import 'package:local_auth/local_auth.dart';
2. 

Troubleshooting

1. I/flutter : PlatformException(no_fragment_activity, local_auth plugin requires activity to be a FragmentActivity., null)

  • Open /android/app/src/main/kotlin/../MainActivity.kt
  • Update the file with following content
package com.[your.package]

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);
    }
}

Please send your feedback and comments to psrdotcom@gmail.com


June 22, 2020

Flutter Android Release Failure [INSTALL_FAILED_NO_MATCHING_ABIS] issue fix

Hi folks,
Today I will let you know the flutter issue of Failure [INSTALL_FAILED_NO_MATCHING_ABIS] and its fix.

Procedure

  • Add the following config in your app/build.gradle

android {
    splits {
           abi {
                 enable true
                 reset()
                 universalApk true
               }
    }
}

flutter {
    source '../..'
}


Release AppBundle / APK

  • Run the following command to generate appbundle
flutter build appbundle
  • Run the following command to generate apk
flutter build apk

References

Featured Post

Java Introdcution

Please send your review and feedback to psrdotcom@gmail.com