forked from axiom-team/gecko
89 lines
2.2 KiB
Dart
89 lines
2.2 KiB
Dart
|
import 'package:flutter/material.dart';
|
||
|
import 'package:gecko/ui/generateWallets.dart';
|
||
|
import 'dart:typed_data';
|
||
|
import 'dart:ui';
|
||
|
import 'package:gecko/ui/historyScreen.dart';
|
||
|
|
||
|
//ignore: must_be_immutable
|
||
|
class HomeScreen extends StatefulWidget {
|
||
|
// const HistoryListScreen({
|
||
|
// final Key key,
|
||
|
// @required this.options,
|
||
|
// @required this.builder,
|
||
|
// }) : super(key: key);
|
||
|
|
||
|
// final QueryOptions options;
|
||
|
// final QueryBuilder builder;
|
||
|
|
||
|
HomeScreen({this.screens});
|
||
|
final List<Widget> screens;
|
||
|
|
||
|
@override
|
||
|
_HomeScreenState createState() => _HomeScreenState();
|
||
|
}
|
||
|
|
||
|
class _HomeScreenState extends State<HomeScreen> {
|
||
|
GlobalKey<HistoryScreenState> _keyHistory = GlobalKey();
|
||
|
|
||
|
int _currentIndex = 0;
|
||
|
Widget currentScreen;
|
||
|
|
||
|
void onTabTapped(int index) {
|
||
|
setState(() {
|
||
|
_currentIndex = index;
|
||
|
});
|
||
|
}
|
||
|
|
||
|
Uint8List bytes = Uint8List(0);
|
||
|
|
||
|
@override
|
||
|
Widget build(BuildContext context) {
|
||
|
return MaterialApp(
|
||
|
home: Scaffold(
|
||
|
backgroundColor: Colors.grey[300],
|
||
|
body: SafeArea(
|
||
|
child: IndexedStack(
|
||
|
index: _currentIndex,
|
||
|
children: <Widget>[
|
||
|
HistoryScreen(
|
||
|
keyHistory: _keyHistory,
|
||
|
),
|
||
|
GenerateWalletScreen(),
|
||
|
// FriendsScreen()
|
||
|
],
|
||
|
),
|
||
|
),
|
||
|
floatingActionButton: Container(
|
||
|
height: 80.0,
|
||
|
width: 80.0,
|
||
|
child: FittedBox(
|
||
|
child: FloatingActionButton(
|
||
|
onPressed: () => _keyHistory.currentState.scan(), // _scan(),
|
||
|
child: Container(
|
||
|
height: 40.0,
|
||
|
width: 40.0,
|
||
|
child: Image.asset('images/scanner.png')),
|
||
|
backgroundColor: Color.fromARGB(500, 204, 255, 255),
|
||
|
),
|
||
|
),
|
||
|
),
|
||
|
bottomNavigationBar: BottomNavigationBar(
|
||
|
fixedColor: Colors.black,
|
||
|
type: BottomNavigationBarType.fixed,
|
||
|
onTap: onTabTapped,
|
||
|
currentIndex: _currentIndex,
|
||
|
items: [
|
||
|
BottomNavigationBarItem(
|
||
|
icon: new Icon(Icons.format_list_bulleted),
|
||
|
label: 'HOME',
|
||
|
),
|
||
|
BottomNavigationBarItem(
|
||
|
icon: new Icon(Icons.settings),
|
||
|
label: 'GENERATE WALLET',
|
||
|
)
|
||
|
],
|
||
|
),
|
||
|
));
|
||
|
}
|
||
|
}
|