Thinking & coding: First BIG problem, NavigationRail spacing between the icons.

First major programming problem
There has been a moment of silence on this blog and in my code sessions. But below you will be able to read why. I am on my first major programming problem. This problem is already taking up 4 coding sessions.

Solution
In my prototype, the icons in the navigation rail are further apart than the NavigationRail widget automatically places them. I searched the net and found an article by Ankit Chowdhury. It contains the following solution

NavigationRailDestination (
  icon: Padding (
      padding: const EdgeInsets.symmetric (vertical: 24),
      child: Icon (Icons.av_timer)),
  label: SizedBox.shrink (),
),


I can't use this
Unfortunately, I can't use this solution to place the icons further vertically.

The reason for this is that I need the minimum width of the Navigationral in my design. But part of the solution is to set 'labelType' to 'All'. Once this setting is used, the Navigationrail's minimum width becomes 74px instead of 54px as I need.

So I will have to find another solution. The whole net searched and no solutions can be found.

I think there are 2 solutions. The first is to design special lcones but this is actually a way around the problem. The next possibility is that I can make adjustments somewhere in the code of the Navigation rail. But this is possible and this is also ALLOWED. I have asked a few people the question. I'm curious about the answer.

There is a third possibility and that is to build the NavigatioRail myself with layout widgets as it was done before the existence of the NavigationRail. But I don't really want to take this path if it is not really necessary.

I know I've wasted quite a bit of time fixing myself on this layout problem, but I don't believe in avoiding problems. Finally, if the customer wants it that way, I have to build the layout according to the customer's requirements. So it will take the time it takes.

Furthermore, I actually find it strange that no one else has raised this problem yet. After all, this 'layout' widget is an important part.

Until the next and hopefully with a fix. Maybe you have a solution for this problem, and if you want to help? Leave a comment.

Do, believe and be happy,

Stefaan



THANK YOU
Ankit Chowdhury 
https://medium.com/flutter-community/flutter-navigationrail-widget-new-in-v1-17-4b8c5416a081
Max Weber 
Filip Hráček


Comments

Popular posts from this blog

Thinking & coding: Linking Firebase to my Flutter App. Watch out for a important detail.

Software developer yes, but where to begin?

Thinking & coding: Small but important code implementations.