From f4dd6c2b8a6614df7ced1121482a30604531cb2a Mon Sep 17 00:00:00 2001 From: Shivam Goyal Date: Sun, 24 Nov 2019 06:26:25 +0530 Subject: [PATCH] v0.7.0-beta-withVoice --- lib/screens/homePage.dart | 186 ------------------------------------ lib/screens/homeScreen.dart | 18 ++++ 2 files changed, 18 insertions(+), 186 deletions(-) delete mode 100644 lib/screens/homePage.dart diff --git a/lib/screens/homePage.dart b/lib/screens/homePage.dart deleted file mode 100644 index 0a56985..0000000 --- a/lib/screens/homePage.dart +++ /dev/null @@ -1,186 +0,0 @@ -import 'package:flutter/material.dart'; - -import 'homeScreen.dart'; -import 'rewardzScreen.dart'; -import 'settingsScreen.dart'; -import 'transactionHistoryScreen.dart'; -import 'voicePayDialog.dart'; - -class MyHomePage extends StatefulWidget { - @override - _MyHomePageState createState() => _MyHomePageState(); -} - -class _MyHomePageState extends State { - PageController _myPage = PageController(initialPage: 0); - - @override - Widget build(BuildContext context) { - return Scaffold( - body: PageView( - controller: _myPage, - children: [ - Center( - child: Container( - child: HomeScreen(), - ), - ), - Center( - child: Container( - child: TransactionHistoryScreen(), - ), - ), - Center( - child: Container( - child: RewardzScreen(), - ), - ), - Center( - child: Container( - child: SettingsScreen(), - ), - ), - ], - physics: - NeverScrollableScrollPhysics(), // Comment this if you need to use Swipe. - ), - floatingActionButton: FloatingActionButton( - elevation: 4.0, - child: Icon( - Icons.mic_none, - size: 25, - ), - onPressed: () { - showDialog( - context: context, - builder: (BuildContext context) { - return VoicePay(); - }, - ); - }, - ), - floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, - bottomNavigationBar: BottomAppBar( - shape: CircularNotchedRectangle(), - notchMargin: 8.0, - elevation: 8.0, - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.end, - children: [ - IconButton( - icon: Icon(Icons.home), - onPressed: () { - setState(() { - _myPage.jumpToPage(0); - }); - }, - ), - Container( - width: 45.0, - height: 6.0, - decoration: BoxDecoration( -// color: _myPage.page == 0 ? Colors.blue : Colors.transparent, - color: Colors.blue, - borderRadius: new BorderRadius.only( - topLeft: Radius.circular(16), - topRight: Radius.circular(16), - bottomLeft: Radius.circular(0), - bottomRight: Radius.circular(0), - ), - ), - ), - ], - ), - Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.end, - children: [ - IconButton( - icon: Icon(Icons.history), - onPressed: () { - setState(() { - _myPage.jumpToPage(1); - }); - }, - ), - Container( - width: 45.0, - height: 6.0, - decoration: BoxDecoration( -// color: _myPage.page == 1 ? Colors.blue : Colors.transparent, - borderRadius: new BorderRadius.only( - topLeft: Radius.circular(16), - topRight: Radius.circular(16), - bottomLeft: Radius.circular(0), - bottomRight: Radius.circular(0), - ), - ), - ), - ], - ), - SizedBox(width: 80), - Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.end, - children: [ - IconButton( - icon: Icon(Icons.card_giftcard), - onPressed: () { - setState(() { - _myPage.jumpToPage(2); - }); - }, - ), - Container( - width: 45.0, - height: 6.0, - decoration: BoxDecoration( -// color: _myPage.page == 2 ? Colors.blue : Colors.transparent, - borderRadius: new BorderRadius.only( - topLeft: Radius.circular(16), - topRight: Radius.circular(16), - bottomLeft: Radius.circular(0), - bottomRight: Radius.circular(0), - ), - ), - ), - ], - ), - Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.end, - children: [ - IconButton( - icon: Icon(Icons.person), - onPressed: () { - setState(() { - _myPage.jumpToPage(3); - }); - }, - ), - Container( - width: 45.0, - height: 6.0, - decoration: BoxDecoration( -// color: _myPage.page == 3 ? Colors.blue : Colors.transparent, - borderRadius: new BorderRadius.only( - topLeft: Radius.circular(16), - topRight: Radius.circular(16), - bottomLeft: Radius.circular(0), - bottomRight: Radius.circular(0), - ), - ), - ), - ], - ), - ], - ), - ), - ); - } -} diff --git a/lib/screens/homeScreen.dart b/lib/screens/homeScreen.dart index cac0802..d40ff3d 100644 --- a/lib/screens/homeScreen.dart +++ b/lib/screens/homeScreen.dart @@ -4,6 +4,8 @@ import 'package:barcode_scan/barcode_scan.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'voicePayDialog.dart'; + class HomeScreen extends StatefulWidget { @override _HomeScreenState createState() => _HomeScreenState(); @@ -15,6 +17,22 @@ class _HomeScreenState extends State { @override Widget build(BuildContext context) { return Scaffold( + floatingActionButton: FloatingActionButton( + elevation: 4.0, + child: Icon( + Icons.mic_none, + size: 25, + ), + onPressed: () { + showDialog( + context: context, + builder: (BuildContext context) { + return VoicePay(); + }, + ); + }, + ), + floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, backgroundColor: Colors.white, body: ListView( padding: EdgeInsets.only(top: 40.0),