Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The DotNavigationBar overflowed by 43 pixels on the bottom. #15

Open
FabioTambu opened this issue Feb 22, 2023 · 3 comments
Open

The DotNavigationBar overflowed by 43 pixels on the bottom. #15

FabioTambu opened this issue Feb 22, 2023 · 3 comments

Comments

@FabioTambu
Copy link

I tried to insert the DotNavigationBar for the first time and immediately the error appears: A RenderFlex overflowed by 43 pixels on the bottom.

I tried to fix it but i can't, can someone help me?

My code:

import 'package:flutter/material.dart';
import 'package:dot_navigation_bar/dot_navigation_bar.dart';


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

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

class _MainPageState extends State<MainPage> {
  
  int selectedIndex = 0;
  late PageController pageController;

  void _handleIndexChanged(int index) {
    setState(() {
      selectedIndex = index;
    });
  }

  void initState() {
    super.initState();
    pageController = PageController(initialPage: selectedIndex);
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          backgroundColor: Colors.purple,
          title: const Text('Test'),
        ),
        body: Container(),
        extendBody: false,
        bottomNavigationBar: DotNavigationBar(
            margin: EdgeInsets.only(left: 10, right: 10),
            currentIndex: selectedIndex,
            dotIndicatorColor: Colors.white,
            unselectedItemColor: Colors.grey[300],
            onTap: _handleIndexChanged,
            items: [
              DotNavigationBarItem(
                icon: Icon(Icons.home),
                selectedColor: Colors.purple,
              ),
              DotNavigationBarItem(
                  icon: Icon(Icons.favorite_border),
                  selectedColor: Colors.pink
              ),
              DotNavigationBarItem(
                icon: Icon(Icons.search),
                selectedColor: Colors.orange,
              ),
              DotNavigationBarItem(
                icon: Icon(Icons.person),
                selectedColor: Colors.teal,
              ),
            ]
        )
    );
  }
}
@DanielSmith1239
Copy link

Hi, you ever figure out this issue?

@rikbrown
Copy link

rikbrown commented Jun 2, 2023

Hitting the same issue.

@arpit16Apr
Copy link

Please Set

itemPadding: EdgeInsets.all(16),
marginR: EdgeInsets.symmetric(horizontal: 80, vertical: 0),
paddingR: EdgeInsets.symmetric(horizontal: 16, vertical: 0),

Fixed,
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants