Giter Site home page Giter Site logo

Comments (6)

BilalShahid13 avatar BilalShahid13 commented on June 8, 2024 3
onItemSelected: (int) {
          setState(
              () {}); // This is required to update the nav bar if Android back button is pressed
        },

This is not required in your case BTW as you are not using a custom style.

from persistentbottomnavbar.

StefanSpeterDev avatar StefanSpeterDev commented on June 8, 2024 1

Awesome! I'm running the latest version anyway, I will try that tmr and if it works I will close the issue! Thx for the reply

from persistentbottomnavbar.

BilalShahid13 avatar BilalShahid13 commented on June 8, 2024

It is possible but only in version 2.0.0 and above. I would do it like this using the property decoration:

decoration: NavBarDecoration(
          border: Border(
            top: BorderSide(width: 5.0, color: Colors.black),
          ),
),

from persistentbottomnavbar.

StefanSpeterDev avatar StefanSpeterDev commented on June 8, 2024

I'm facing an issue caused by borderRadius, here is what it says:
The following assertion was thrown during paint(): A borderRadius can only be given for uniform borders. 'package:flutter/src/painting/box_border.dart': Failed assertion: line 523 pos 12: 'borderRadius == null'
And below it's the code I'm using:

@override
  Widget build(BuildContext context) {
    return PersistentTabView(
        controller: _controller,
        screens: _buildScreens(),
        items: _navBarsItems(),
        // Redundant here but defined to demonstrate for other than custom style
        confineInSafeArea: true,
        backgroundColor: Colors.white,
        popAllScreensOnTapOfSelectedTab: true,
        handleAndroidBackButtonPress: true,
        decoration: NavBarDecoration(
          border: Border(
            top: BorderSide(width: 5.0, color: Colors.black),
          ),
        ),
        onItemSelected: (int) {
          setState(
              () {}); // This is required to update the nav bar if Android back button is pressed
        },
        itemCount: 5,
        navBarStyle:
            NavBarStyle.style5 // Choose the nav bar style with this property
        );
  }

I've noticed that if I add a bottom/left/right to the border with the exact same properties (same width and same color), the error doesn't show anymore.
The problem is that it makes my navbar looks super weird.

from persistentbottomnavbar.

BilalShahid13 avatar BilalShahid13 commented on June 8, 2024

Upgrade to version 2.0.5 :) Thanks for reporting!

from persistentbottomnavbar.

StefanSpeterDev avatar StefanSpeterDev commented on June 8, 2024

It works! Good job :)

from persistentbottomnavbar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.