Files
SpotiFLAC-Mobile/lib/utils/nav_bar_inset.dart
T
zarzet 63e1a9b9c8 feat(ui): add Mornye glass theme and adaptive music player
Add a selectable Mornye theme with shared glass controls, dialogs, sheets, notifications, and collection headers while retaining Material components.

Update player artwork, lyrics transitions and highlighting, synchronized rolling time labels, volume controls, and compact navigation. Unify metadata, Library, search, and extension surfaces; preserve restored artwork and report extension load failures.

Validation: full Flutter analyzer clean; 713 tests passed and 4 skipped; pinned Dart formatting and diff checks passed; signed ARM64 and ARM32 release APKs built and verified.
2026-09-19 12:10:10 +07:00

27 lines
1.1 KiB
Dart

import 'package:flutter/widgets.dart';
/// Bottom inset needed to clear the transparent shell navigation bar.
///
/// The shell Scaffold uses `extendBody: true`, so its body (and any route
/// pushed inside the tab navigators) receives the navbar height plus the system
/// gesture inset as `MediaQuery.padding.bottom`. Scrollable screens add this as
/// trailing padding so their last item can scroll clear of the bar while the
/// content still shows faintly behind it.
extension NavBarInset on BuildContext {
double get navBarBottomInset => MediaQuery.paddingOf(this).bottom;
}
/// Keeps animated navigation-bar insets local to the trailing spacer instead
/// of rebuilding the screen and its lists on every chrome animation frame.
class NavBarSliverSpacer extends StatelessWidget {
const NavBarSliverSpacer({super.key, this.bottomInset});
/// An explicit inset for surfaces that do not inherit the shell's padding.
final double? bottomInset;
@override
Widget build(BuildContext context) => SliverToBoxAdapter(
child: SizedBox(height: bottomInset ?? context.navBarBottomInset),
);
}