♻️ Refactor the bottom nav display

This commit is contained in:
2025-10-01 16:35:41 +08:00
parent ac2951479b
commit 3bfc0b8181
12 changed files with 47 additions and 103 deletions

View File

@@ -15,32 +15,3 @@ bool isWiderScreen(BuildContext context) {
bool isWidestScreen(BuildContext context) {
return MediaQuery.of(context).size.width > kWidescreenWidth;
}
EdgeInsets getTabbedPadding(
BuildContext context, {
double? horizontal,
double? vertical,
double? left,
double? right,
double? top,
double? bottom,
}) {
if (isWideScreen(context)) {
return EdgeInsets.only(
left: left ?? horizontal ?? 0,
right: right ?? horizontal ?? 0,
top: top ?? vertical ?? 0,
bottom: bottom ?? vertical ?? 0,
);
}
final effectiveBottom = bottom ?? vertical;
return EdgeInsets.only(
left: left ?? horizontal ?? 0,
right: right ?? horizontal ?? 0,
top: top ?? vertical ?? 0,
bottom:
effectiveBottom != null
? effectiveBottom + MediaQuery.of(context).padding.bottom + 56
: MediaQuery.of(context).padding.bottom + 56,
);
}