Closed nazrinharris closed 3 years ago
This seems a weird question to me. If you know how to create a FAB, it is not much different with or without this package.
I assume that you think the BottomNavigationView and FloatingActionButton should be in the same scaffold. However, it doesn't have to be. You can add your own scaffold to a page.
Example code:
pages: [
(_) => Scaffold(
floatingActionButton: FloatingActionButton(
onPressed: () {},
),
body: Center(child: Text("Welcome to bottom_nav_layout"))),
(_) => SliderPage(),
(_) => Center(
child: TextField(decoration: InputDecoration(hintText: 'Go..')),
),
],
I see, somehow I didn't think of doing like that.
Your assumption was correct, I did think that it needs to be in the same scaffold.
Now, I'm doing it a bit differently, by using a stack and putting the fab on top of the whole view. It works fine for now but thanks for helping me (✿◡‿◡)
For what you are trying to achieve, the stack approach seems inappropriate to me. I would advise against it. It would still work but you do not need a stack for a FAB.
But still, I do not know the context of your situation. Might be good.
As of now, I couldn't find any way to do this directly from scaffold. I'll try doing it with Stack and all but I'd like to know if there is an easier way to do so.