native_auth 1.0.5 copy "native_auth: ^1.0.5" to clipboard
native_auth: ^1.0.5 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();
    });
  }
}
30
likes
140
pub points
74%
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