Profile Page

This commit is contained in:
2023-02-25 20:53:09 -05:00
parent 26255e6bc5
commit 1bd7a62d15
2 changed files with 332 additions and 38 deletions

View File

@@ -1,10 +1,11 @@
import 'package:flutter/material.dart';
import 'package:flutterfire_ui/auth.dart';
import 'package:persistent_bottom_nav_bar/persistent_tab_view.dart';
import 'profile_screen_custom.dart';
import 'main_screen.dart';
class HomeScreen extends StatefulWidget {
const HomeScreen({ Key? key }) : super(key: key);
const HomeScreen({Key? key}) : super(key: key);
@override
_HomeScreenState createState() => _HomeScreenState();
@@ -12,25 +13,21 @@ class HomeScreen extends StatefulWidget {
class _HomeScreenState extends State<HomeScreen> {
late PersistentTabController _controller;
@override
@override
void initState() {
super.initState();
_controller = PersistentTabController();
}
List<Widget> _buildScreens() => [
const MainScreen(),
const MainScreen(),
const MainScreen(),
const ProfileScreenCustom(),
const MainScreen(),
];
List<PersistentBottomNavBarItem> _navBarsItems() => [
PersistentBottomNavBarItem(
icon: const Icon(Icons.shopping_cart),
title: "Buy",
activeColorPrimary: Colors.blue,
inactiveColorPrimary: Colors.grey,
inactiveColorSecondary: Colors.purple),
PersistentBottomNavBarItem(icon: const Icon(Icons.shopping_cart), title: "Buy", activeColorPrimary: Colors.blue, inactiveColorPrimary: Colors.grey, inactiveColorSecondary: Colors.purple),
PersistentBottomNavBarItem(
icon: const Icon(Icons.attach_money),
title: "Sell",
@@ -59,36 +56,38 @@ class _HomeScreenState extends State<HomeScreen> {
),
),
];
@override
Widget build(BuildContext context) {
return PersistentTabView(
context,
controller: _controller,
screens: _buildScreens(),
items: _navBarsItems(),
confineInSafeArea: true,
backgroundColor: Colors.white, // Default is Colors.white.
handleAndroidBackButtonPress: true, // Default is true.
resizeToAvoidBottomInset: true, // This needs to be true if you want to move up the screen when keyboard appears. Default is true.
stateManagement: true, // Default is true.
hideNavigationBarWhenKeyboardShows: true, // Recommended to set 'resizeToAvoidBottomInset' as true while using this argument. Default is true.
decoration: NavBarDecoration(
borderRadius: BorderRadius.circular(10.0),
colorBehindNavBar: Colors.white,
),
popAllScreensOnTapOfSelectedTab: true,
popActionScreens: PopActionScreensType.all,
itemAnimationProperties: const ItemAnimationProperties( // Navigation Bar's items animation properties.
duration: Duration(milliseconds: 200),
curve: Curves.ease,
),
screenTransitionAnimation: const ScreenTransitionAnimation( // Screen transition animation on change of selected tab.
animateTabTransition: true,
curve: Curves.ease,
duration: Duration(milliseconds: 200),
),
navBarStyle: NavBarStyle.style13, // Choose the nav bar style with this property.
context,
controller: _controller,
screens: _buildScreens(),
items: _navBarsItems(),
confineInSafeArea: true,
backgroundColor: Colors.white, // Default is Colors.white.
handleAndroidBackButtonPress: true, // Default is true.
resizeToAvoidBottomInset: true, // This needs to be true if you want to move up the screen when keyboard appears. Default is true.
stateManagement: true, // Default is true.
hideNavigationBarWhenKeyboardShows: true, // Recommended to set 'resizeToAvoidBottomInset' as true while using this argument. Default is true.
decoration: NavBarDecoration(
borderRadius: BorderRadius.circular(10.0),
colorBehindNavBar: Colors.white,
),
popAllScreensOnTapOfSelectedTab: true,
popActionScreens: PopActionScreensType.all,
itemAnimationProperties: const ItemAnimationProperties(
// Navigation Bar's items animation properties.
duration: Duration(milliseconds: 200),
curve: Curves.ease,
),
screenTransitionAnimation: const ScreenTransitionAnimation(
// Screen transition animation on change of selected tab.
animateTabTransition: true,
curve: Curves.ease,
duration: Duration(milliseconds: 200),
),
navBarStyle: NavBarStyle.style13, // Choose the nav bar style with this property.
);
}
}
}