good day my fellow coders
I have a little problem where I am running firebase auth and cloud firestore in a flutter app with a curved nav bar.
Now here is my problem on home_screen.dart file I had to add 3 things in order to get my crud function to work see code below:
class HomeScreen extends StatelessWidget {
User user;
HomeScreen(this.user);
FirebaseFirestore firestore = FirebaseFirestore.instance;
@override
Widget build(BuildContext context) {
return Scaffold(........
Now within my main_screen where my curved navigation bar is situated there is a _pageOption = [] there see below:
class _mainScreenState extends State<mainScreen> {
int _page = 0;
final _pageOption = [
add pages here
HomeScreen(),
AddCardScreen(),
];
Where i have the issue is everything is imported and works fine however when i pass this.user on the HomeScreen(), as it should be then I receive the Error:
Can't access 'this' in a field initializer.