I am building a Flutter app where I have a login form, which is connected with a firebasee database.
I would like to implement a navigation Bar when the user succesfully logs in.
The first page after login is the HomeTab. My app crashes when i add a BottomNavBar widget here.
could you help me please?
my GitHub repo:
https://github.com/GergoJeles/assignment2_07.11.2023.git
import 'package:firebase_ui_auth/firebase_ui_auth.dart';
import 'package:flutter/material.dart';
import 'BottomNavBar.dart'; // Import your custom BottomNavBar widget here
import 'NavBar.dart'; // Import your custom NavBar widget here
import 'AboutTab.dart'; // Import your AboutTab widget
import 'MapTab.dart'; // Import your MapTab widget
import 'ProfileTab.dart'; // Import your ProfileTab widget
class HomeTab extends StatelessWidget {
const HomeTab({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
actions: [
IconButton(
icon: const Icon(Icons.person),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute<ProfileScreen>(
builder: (context) => ProfileScreen(
appBar: AppBar(
title: const Text('User Profile'),
),
actions: [
SignedOutAction((context) {
Navigator.of(context).pop();
})
],
children: [
const Divider(),
Padding(
padding: const EdgeInsets.all(2),
child: AspectRatio(
aspectRatio: 1,
child: Image.asset('flutterfire_300x.png'),
),
),
],
),
),
);
},
)
],
automaticallyImplyLeading: false,
),
body: Center(
child: Column(
children: [
Image.asset('assets/dash.png'),
Text(
'Welcome!',
style: Theme.of(context).textTheme.displaySmall,
),
const SignOutButton(),
],
),
),
// Add a custom BottomNavBar widget here
bottomNavigationBar: BottomNavBar(),
);
}
}
the app crasghed when i tried this
create a Screen for user detials, and add in action
and follow the bottomNavigationBar code below
import screen as per your design view