sooxt98 / google_nav_bar

A modern google style nav bar for flutter.
MIT License
735 stars 114 forks source link

Debug console shows this message "ensureControlAlpha: for ITYPE_NAVIGATION_BAR" when GNav does not show? #83

Open Mleendox opened 1 year ago

Mleendox commented 1 year ago

So in my app, I have the GNav bar to navigate between some pages. I use Firebase Auth to sign in users. Right after a user signs in, the app navigates to the main page where the GNav is.

class MainPage extends StatefulWidget
{
  const MainPage({Key? key}) : super(key: key);

  @override
  State<MainPage> createState() => _MainPageState();
}

class _MainPageState extends State<MainPage>
{
  final _utils = Utils();
  int _gNavBarIndex = 0;
  final _listPages = [const HomePage(), const Rides(), const ProfilePage()];

  @override
  Widget build(BuildContext context)
  {
    return Scaffold(
      backgroundColor: Colors.blueGrey[100],
      body: _listPages[_gNavBarIndex],
      bottomNavigationBar: Container(
        decoration: BoxDecoration(
          color: _utils.darkBlueGrey,
          borderRadius: BorderRadius.circular(16)
        ),
        child:  Padding(
          padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 10),
          child: GNav(
            backgroundColor: _utils.darkBlueGrey!,
            color: Colors.tealAccent,
            activeColor: _utils.titleTextColor,
            tabBackgroundColor: Colors.white.withOpacity(0.5),
            gap: 10,
            padding: const EdgeInsets.all(8.0),
            selectedIndex: _gNavBarIndex,
            onTabChange: (index) {
              setState(() => _gNavBarIndex = index);
            },
            tabs: const [
              GButton(
                icon: Icons.home,
                text: 'Home',
              ),
              GButton(
                icon: Icons.car_crash_outlined,
                text: 'Rides',
              ),
              GButton(
                icon: Icons.person,
                text: 'Profile',
              )
            ],
          ),
        ),
      ),
    );
  }
}

so from here, the user can now see the HomePage, one of the tabs of the GNav bar. But each time a user logs out and laogs back in, the GNav bar does not appear when they log back in. The debug console shows this message, "ensureControlAlpha: for ITYPE_NAVIGATION_BAR" and I have searched for it and there aren't any information about this message. As a user, I have to close the app and relaunch it, then the GNav bar appears again. Does anyone know how I can fix this issue?

sooxt98 commented 1 year ago

Looks like some sort of Android related issue, perhaps take a look at this https://stackoverflow.com/questions/73513952/errors-while-accessing-camera-in-flutter