Can i show Snackbar below Bottom Navigation Bar ?
what i want :
reality :
Any reply is appreciated :) Thank you so much
Assuming the bottom navigation bar is referred to as the BottomNavigationBar used inside Scaffold class, and snackbar is the SnackBar class, I believe it is hard to achieve. This is because the SnackBar is like an overlay on the screen and the bottomnav class can't tell whether a snackbar is shown or not. Also moving the bottomnav up and down accordingly with the snackbar is a challenge itself.
If I wanted to create what you want, I'd do something like this. I'll creat a custom snackbar-like widget. This widget is structured like this
Column(
children: [
Expanded(
child: Scaffold(
appBar: AppBar(
title: const Text("Hallo"),
),
body: const Center(
child: Text("Hello"),
),
),
),
CustomSnackBarLikeWidget(),
],
);
the CustomSnackBarLikeWidget() is normally not shown (height is 0) making the scaffold use the whole screen height thus the bottomnav sticking to the bottom. In cases when the CustomSnackBarLikeWidget() is shown, it has some sort of contents (some height) and will shove the bottomnav upwards, like snackbar below navigation bar
the CustomSnackBarLikeWidget() will also be a complicated widget. This widget will constantly be watching if you have called this widget to show any snackbar contents.
I don't know if my answer helps but feel free to ask me questions.