Created
May 5, 2019 17:02
-
-
Save GreyHat147/d5cd5bb7acfcc414e75dd3ff7b225632 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/cupertino.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:promociones/pages/login_signup_page.dart'; | |
import './home_page.dart'; | |
import 'package:promociones/services/authentication.dart'; | |
import './nearme.dart'; | |
import './notification.dart'; | |
import './wallet.dart'; | |
import '../modals/MyRewards.dart'; | |
import './map_page.dart'; | |
import './my_profile.dart'; | |
class TabBarPage extends StatefulWidget { | |
TabBarPage({Key key, this.auth, this.userId, this.onSignedOut}) | |
: super(key: key); | |
final BaseAuth auth; | |
final VoidCallback onSignedOut; | |
final String userId; | |
@override | |
_TabBarPage createState() => new _TabBarPage(); | |
} | |
class _TabBarPage extends State<TabBarPage> { | |
_TabBarPage({Key key, this.auth, this.userId, this.onSignedOut}); | |
final BaseAuth auth; | |
final VoidCallback onSignedOut; | |
final String userId; | |
void _onTap(int value) { | |
print('Value => $value'); | |
} | |
@override | |
void dispose() { | |
super.dispose(); | |
} | |
@override | |
Widget build(BuildContext context) { | |
return CupertinoTabScaffold( | |
tabBar: CupertinoTabBar( | |
onTap: _onTap, | |
activeColor: new Color.fromRGBO(148, 3, 123,1.0), | |
items: <BottomNavigationBarItem> [ | |
new BottomNavigationBarItem( | |
title: new Text('Home'), | |
icon: new Icon( | |
Icons.home, | |
size: 22, | |
), | |
), | |
new BottomNavigationBarItem( | |
title: new Text('Near me'), | |
icon: new Icon( | |
Icons.location_on, | |
size: 22, | |
), | |
), | |
new BottomNavigationBarItem( | |
icon: new Icon( | |
Icons.map, | |
size: 22, | |
), | |
title: new Text('Map') | |
), | |
new BottomNavigationBarItem( | |
title: new Text('Notifications'), | |
icon: new Icon( | |
Icons.notifications, | |
size: 22, | |
) | |
), | |
new BottomNavigationBarItem( | |
title: new Text('Wallet'), | |
icon: new Icon( | |
Icons.account_balance_wallet, | |
size: 22, | |
) | |
), | |
], | |
), | |
tabBuilder: (BuildContext context, int index) { | |
switch(index) { | |
case 0: | |
print(this.auth); | |
return CupertinoTabView( | |
builder: (BuildContext context) { | |
return HomePage(); | |
}, | |
); | |
break; | |
case 1: | |
return CupertinoTabView( | |
builder: (BuildContext context) { | |
return NearMe(); | |
}, | |
); | |
break; | |
case 2: | |
return CupertinoTabView( | |
builder: (BuildContext context) { | |
return MapPage(); | |
}, | |
); | |
break; | |
case 3: | |
return CupertinoTabView( | |
builder: (BuildContext context) { | |
return Notifications(); | |
}, | |
); | |
break; | |
case 4: | |
return CupertinoTabView( | |
builder: (BuildContext context) { | |
return Wallet(); | |
}, | |
routes: { | |
"/myRewards": (BuildContext context) => new MyRewards(), | |
"/myProfile": (BuildContext context) => new MyProfile(), | |
}, | |
); | |
break; | |
} | |
}, | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment