native_auth 1.0.6 copy "native_auth: ^1.0.6" to clipboard
native_auth: ^1.0.6 copied to clipboard

this package is to implement faceID, touchID and fingerprint authentication

example/lib/main.dart

import 'dart:developer';
import 'package:flutter/material.dart';
import 'package:native_auth/native_auth.dart';

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      title: 'Flutter Demo',
      home: HomePage(),
    );
  }
}

class HomePage extends StatefulWidget {
  const HomePage({super.key});

  @override
  createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  String valueAuth = "No initialized";

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text("Auth")),
      bottomNavigationBar: buttonAuth(),
      body: Center(child: Text(valueAuth)),
    );
  }

  Widget buttonAuth() {
    return SafeArea(
      child: Padding(
        padding: const EdgeInsets.symmetric(horizontal: 20),
        child: ElevatedButton(onPressed: auth, child: const Text("Auth me")),
      ),
    );
  }

  Future<void> auth() async {
    final response = await Auth.isAuthenticate();
    log('is authenticated: ${response.isAuthenticated}');
    setState(() {
      valueAuth = response.toString();
    });
  }
}
29
likes
140
pub points
73%
popularity

Publisher

unverified uploader

this package is to implement faceID, touchID and fingerprint authentication

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter, local_auth, local_auth_android, local_auth_ios

More

Packages that depend on native_auth