-
Notifications
You must be signed in to change notification settings - Fork 47
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
[Bug] SliderDrawer has invisible overlay right below App Bar #23
Comments
This is by design. You'll need to mess around with scaffold stacking. Scaffold Something similar to this should slide the content of the scaffold from appbar and body but will not slide the bottom nav bar. Just need to think of widgets are a layer upon layer. |
But when I place the navigation bar inside the body of SliderDrawer the bottom navigation bar will not be pushed out of the screen when opening the drawer. Did you manage to solve that? @InFaMoUsZero |
Do you mean the child of the SliderDrawer? My child contains the entire scaffold for my app, that includes appbar, body and bottom nav bar. The slider pushes it all. |
Can you post an example? @InFaMoUsZero
|
Try removing the top scaffold. My SliderDrawer is the root widget. The child is the entire app including scaffold. return SliderDrawer(
key: _key,
appBar: Container(),
slider: CupertinoScaffold(
body: CupertinoPageScaffold(
child: Container(color: CupertinoColors.systemBlue),
),
),
child: CupertinoScaffold(
body: Builder(builder: (context) {
return CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(...)
),
),
);
}), The idea is the slider is the root, the child is the app that it pushes to the side. |
Can you also post the content of you |
Is this an issue regarding #21? return CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
backgroundColor: Colors.white,
leading: CupertinoButton(
padding: const EdgeInsets.only(top: 6),
child: const Icon(CupertinoIcons.line_horizontal_3),
onPressed: () {
_key.currentState?.toggle();
},
),
middle: Column(
children: [
const Text(
"Title",
style: TextStyle(color: Colors.black, fontSize: 19),
),
Text(
'Subtitle',
style: TextStyle(color: Colors.grey[600], fontSize: 12),
)
],
),
), I would avoid using SliderAppBar from this library, it uses IconButton which forces you to have a material root widget, which you don't have because you would have removed it as I suggested. Use a material or Cupertino appbar within the scaffold. Your menu item will then need need to call _key.currentstate.toggle() to open the slider like in the example above. You can use Material or Cupertino, the same result should be achieved. |
Am I doing something wrong here? @InFaMoUsZero
Output:
|
final GlobalKey<SliderDrawerState> _key = GlobalKey<SliderDrawerState>();
....
return SliderDrawer(
key: _key
slider: Scaffold(
body: Container(color: Colors.red),
),
child: Scaffold(
appBar: AppBar(
leading: CupertinoButton(
child: const Icon(CupertinoIcons.line_horizontal_3),
onPressed: () {
_key.currentState?.toggle();
},
),
title: Text("E"),
),
body: getContent()
bottomNavigationBar: // Your navigation bottom bar
);
} This should do the trick. Don't use anything on SliderDrawer apart from the slider and key properties. |
FABULOSE! This now works! It would be very cool if bug #21 and bug #23 will be fixed soon so we do not have to work with workarounds. If you need any help @NikhilVadoliya, just hit me up. Kind regards to you @InFaMoUsZero! |
Okay @InFaMoUsZero , i will work on this issue. |
First of all, thank you for that amazing package @NikhilVadoliya!
Sadly, I have found a bug which makes it impossible for me to use your package until this bug is fixed. I have recreated this bug in this repo so you can see exactly where the problem is. The repo is ready to run on a device.
When you have opened the app you see two buttons right below the
appBar
. Normally they should increase and decrease the counter, however they don't. This is because of the overlay. Now to line 51 and change the variableuseSafeArea
to true and reload the app. Now the whole content is wrapped in aSaveArea
widget and as you can see, the buttons inside theListView
has slid down a bit. When you now press the button, the counter actually increases and decreases.To show you that the overflow is coming from you SliderDrawer open your slider.dart file and jump to line 200. Change appBarColor to
Colors.black
. Because you have edited a package now you have to pressq
in the terminal to terminate the current application and runflutter run
again. Now you can see that the space between theappBar
and theListView
is filled with black.I already tried to get this problem fixed and change you
Expanded
widget withFlexible
in line 213 in your slider.dart file but sadly this doesn't make any difference. Could you please help me to fix that issue so I can happily use your package?Also, I don't see any other way to implement a
bottomNavigationBar
rather then using aScaffold
inside thechild
property ofSliderDrawer
as thebottomNavigationBar
has to be inside thechild
property ofSliderDrawer
. Otherwise it will not get pushed out of the screen by theDrawer
.Kind regards
The text was updated successfully, but these errors were encountered: