mobile-music/lib/layout/breakpoints.dart
2026-07-30 11:39:33 -04:00

13 lines
651 B
Dart

import 'package:flutter/widgets.dart';
/// Width at/above which the UI switches to a wide, side-by-side layout —
/// Material's "expanded" window class, i.e. tablet landscape (iPad). Keyed off
/// width rather than raw orientation so a phone in landscape (wide but short)
/// stays on the compact layout.
const double kWideBreakpoint = 840;
/// Whether the current window is wide enough for the side-by-side layout.
/// Uses [MediaQuery.sizeOf] so callers rebuild only when the size actually
/// changes, not on every unrelated MediaQuery update.
bool isWideLayout(BuildContext context) =>
MediaQuery.sizeOf(context).width >= kWideBreakpoint;