There isn’t a such drawback on Android, I take advantage of auto_route for navigation, respectively, indents and comparable widgets should not used wherever larger up the widget tree, for the underside panel of AutoTabsRouter, what may very well be the rationale?
enter picture description right here
Under is the principle block of code the place AutoTabsRouter is used:
Widget construct(BuildContext context) {
return AutoTabsRouter(
routes: const [
HomeRoute(),
BranchesRoute(),
QrCodeRoute(),
NewsRoute(),
ProfileRoute(),
],
builder: (context, youngster) {
last tabsRouter = AutoTabsRouter.of(context);
return Scaffold(
physique: youngster,
bottomNavigationBar: Stack(
alignment: Alignment.middle,
kids: [
BottomNavigationBar(
currentIndex: tabsRouter.activeIndex,
onTap: (index) => _openPage(context, index, tabsRouter),
items: [
BottomNavigationBarItem(
label: LocaleKeys.main.tr(),
icon: const ImageIcon(
AssetImage(IconHelper.iconJiraffe),
),
),
BottomNavigationBarItem(
label: LocaleKeys.branches.tr(),
icon: const ImageIcon(
AssetImage(IconHelper.branches),
),
),
const BottomNavigationBarItem(
icon: SizedBox.shrink(),
label: '',
),
BottomNavigationBarItem(
label: LocaleKeys.news.tr(),
icon: const ImageIcon(
AssetImage(IconHelper.news),
),
),
BottomNavigationBarItem(
label: LocaleKeys.profile.tr(),
icon: const ImageIcon(
AssetImage(IconHelper.user),
),
),
],
),
Padding(
padding: EdgeInsets.solely(
backside: MediaQuery.maybePaddingOf(context)?.backside ?? 0,
),
youngster: ElevatedButton(
fashion: ElevatedButton.styleFrom(
backgroundColor: ThemeHelper.gray13,
form: RoundedRectangleBorder(
borderRadius: BorderRadius.round(10),
),
padding: const EdgeInsets.symmetric(
vertical: 6,
horizontal: 14,
),
),
youngster: SvgPicture.asset(IconHelper.viewfinder),
onPressed: () => _showModalBottomSheet(context),
),
),
],
),
);
},
);
Under is the code of the information display screen itself, constructed on the Scaffold widget:
Widget construct(BuildContext context) {
return AutoTabsRouter(
routes: const [
HomeRoute(),
BranchesRoute(),
QrCodeRoute(),
NewsRoute(),
ProfileRoute(),
],
builder: (context, youngster) {
last tabsRouter = AutoTabsRouter.of(context);
return Scaffold(
physique: youngster,
bottomNavigationBar: Stack(
alignment: Alignment.middle,
kids: [
BottomNavigationBar(
currentIndex: tabsRouter.activeIndex,
onTap: (index) => _openPage(context, index, tabsRouter),
items: [
BottomNavigationBarItem(
label: LocaleKeys.main.tr(),
icon: const ImageIcon(
AssetImage(IconHelper.iconJiraffe),
),
),
BottomNavigationBarItem(
label: LocaleKeys.branches.tr(),
icon: const ImageIcon(
AssetImage(IconHelper.branches),
),
),
const BottomNavigationBarItem(
icon: SizedBox.shrink(),
label: '',
),
BottomNavigationBarItem(
label: LocaleKeys.news.tr(),
icon: const ImageIcon(
AssetImage(IconHelper.news),
),
),
BottomNavigationBarItem(
label: LocaleKeys.profile.tr(),
icon: const ImageIcon(
AssetImage(IconHelper.user),
),
),
],
),
Padding(
padding: EdgeInsets.solely(
backside: MediaQuery.maybePaddingOf(context)?.backside ?? 0,
),
youngster: ElevatedButton(
fashion: ElevatedButton.styleFrom(
backgroundColor: ThemeHelper.gray13,
form: RoundedRectangleBorder(
borderRadius: BorderRadius.round(10),
),
padding: const EdgeInsets.symmetric(
vertical: 6,
horizontal: 14,
),
),
youngster: SvgPicture.asset(IconHelper.viewfinder),
onPressed: () => _showModalBottomSheet(context),
),
),
],
),
);
},
);