Installation¶
Requirements¶
- Flutter 3.44 or newer
- Dart 3.12 or newer
Add the dependency¶
flutter pub add flutter_local_authentication
Or add it to your pubspec.yaml:
dependencies:
flutter_local_authentication: ^2.1.0
Then run flutter pub get.
Import it¶
import 'package:flutter_local_authentication/flutter_local_authentication.dart';
This import gives you FlutterLocalAuthentication and AuthenticationMethod. To localize the prompt also import the localization model:
import 'package:flutter_local_authentication/localization_model.dart';
Next: set up each platform. Android and iOS need a small change before the plugin works.