yubikit_flutter 0.0.33 yubikit_flutter: ^0.0.33 copied to clipboard
Wrapper for YubiKit iOS and Android SDKs
import 'package:flutter/material.dart';
import 'package:yubikit_flutter_example/openpgp.dart';
import 'package:yubikit_flutter_example/piv.dart';
void main() {
runApp(const MaterialApp(home: MyApp()));
}
class MyApp extends StatefulWidget {
const MyApp({Key? key}) : super(key: key);
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
int _selectedIndex = 0;
static const List<Widget> _widgetOptions = <Widget>[
OpenPGPPage(),
PivPage(),
];
void _onItemTapped(int index) {
setState(() {
_selectedIndex = index;
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Yubikit'),
),
body: _widgetOptions.elementAt(_selectedIndex),
bottomNavigationBar: BottomNavigationBar(
currentIndex: _selectedIndex,
selectedItemColor: Colors.amber[800],
onTap: _onItemTapped,
items: const <BottomNavigationBarItem>[
BottomNavigationBarItem(
icon: Icon(Icons.home),
label: 'PGP',
),
BottomNavigationBarItem(
icon: Icon(Icons.account_balance),
label: 'PIV',
),
]),
);
}
}