I did not do much and I was trying to use this library as I got this error:
โโโโโโโโ Exception caught by foundation library โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
The following NoSuchMethodError was thrown while dispatching notifications for CircularBottomNavigationController:
The getter 'value' was called on null.
Receiver: null
Tried calling: value
here is my page:
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:visitor_app/screens/add_user_page/screen/add_user_page.dart';
import 'package:visitor_app/screens/home_page/screen/home_page.dart';
import 'package:visitor_app/screens/map_page/screen/map_page.dart';
import 'package:visitor_app/screens/my_users_page/screen/my_users_page.dart';
import 'package:visitor_app/screens/profile_page/screen/profile_page.dart';
import 'package:visitor_app/utils/screen_utils/connection_alert_widget.dart';
import 'package:visitor_app/utils/screen_utils/connection_service.dart';
import 'package:circular_bottom_navigation/circular_bottom_navigation.dart';
import 'package:circular_bottom_navigation/tab_item.dart';
class MainPage extends StatefulWidget {
final int tab;
MainPage({this.tab});
@OverRide
_MainPageState createState() => _MainPageState();
}
class _MainPageState extends State {
AddUserPage addUserPage;
MapPage mapPage;
MyUsersPage myUsersPage;
ProfilePage profilePage;
HomePage homePage;
List pages;
Widget currentPage;
@OverRide
void initState() {
final connectionStatus = ConnectionStatusSingleton.getInstance();
addUserPage = new AddUserPage();
mapPage = new MapPage();
myUsersPage = new MyUsersPage();
profilePage = new ProfilePage();
homePage = new HomePage();
pages = [mapPage, addUserPage, homePage, myUsersPage, profilePage];
currentPage = widget.tab == null ? homePage : pages[widget.tab];
connectionStatus.initialize();
super.initState();
}
@OverRide
Widget build(BuildContext context) {
return WillPopScope(
onWillPop: () {},
child: Scaffold(
body: Stack(
children: [currentPage, ConnectionAlertWidget()],
),
bottomNavigationBar: CircularBottomNavigation(
List.of([
TabItem(Icons.home, "Home", Colors.black,
labelStyle: TextStyle(fontFamily: "Ir")),
TabItem(Icons.search, "Search", Colors.black,
labelStyle: TextStyle(fontFamily: "Ir")),
TabItem(Icons.shopping_cart, "Basket", Colors.black,
labelStyle: TextStyle(fontFamily: "Ir")),
TabItem(Icons.search, "Search", Colors.black,
labelStyle: TextStyle(fontFamily: "Ir")),
TabItem(Icons.search, "Search", Colors.black,
labelStyle: TextStyle(fontFamily: "Ir")),
]),
selectedCallback: (position) {
print(position);
// setState(() {
// currentPage = pages[position];
// });
},
)));
}
}