iosContentPad method
Implementation
Widget iosContentPad(BuildContext context, Widget child,
ObstructingPreferredSizeWidget? navigationBar, CupertinoTabBar? tabBar) {
final MediaQueryData existingMediaQuery = MediaQuery.of(context);
if (!iosContentPadding && !iosContentBottomPadding) {
return child;
}
double top = 0;
double bottom = 0;
if (iosContentPadding && navigationBar != null) {
final double topPadding =
navigationBar.preferredSize.height + existingMediaQuery.padding.top;
final obstruct = navigationBar.shouldFullyObstruct(context);
top = obstruct ? 0.0 : topPadding;
}
if (iosContentBottomPadding && tabBar != null) {
bottom = existingMediaQuery.padding.bottom;
}
return Padding(
padding: EdgeInsets.only(top: top, bottom: bottom),
child: child,
);
}