cryppo 0.4.0 cryppo: ^0.4.0 copied to clipboard
A simplified cryptographic library by Meeco - encrypt and decrypt as well as sign and verify data.
import './gcm_page.dart';
import './rsa_page.dart';
import 'package:flutter/material.dart';
void main() async {
runApp(CryppoDemoApp());
}
class CryppoDemoApp extends StatefulWidget {
@override
_CryppoDemoAppState createState() => _CryppoDemoAppState();
}
class _CryppoDemoAppState extends State<CryppoDemoApp> {
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () {
FocusScope.of(context).requestFocus(new FocusNode());
},
child: MaterialApp(
title: 'Cryppo Demo',
home: BottomTabBar(),
),
);
}
}
class BottomTabBar extends StatefulWidget {
BottomTabBar();
@override
_BottomTabBarState createState() => _BottomTabBarState();
}
class _BottomTabBarState extends State<BottomTabBar> {
int _selectedIndex = 0;
static const pageTitles = ['RSA', 'AES', 'File'];
static List<Widget> _widgetOptions = <Widget>[
RsaPage(),
GcmPage(),
];
void _onItemTapped(int index) {
setState(() {
_selectedIndex = index;
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(pageTitles[_selectedIndex]),
),
body: Center(
child: _widgetOptions.elementAt(_selectedIndex),
),
bottomNavigationBar: BottomNavigationBar(
items: const <BottomNavigationBarItem>[
BottomNavigationBarItem(
icon: Icon(Icons.enhanced_encryption),
label: 'RSA',
),
BottomNavigationBarItem(
icon: Icon(Icons.lock),
label: 'AES',
),
],
currentIndex: _selectedIndex,
selectedItemColor: Colors.amber[800],
onTap: _onItemTapped,
),
);
}
}