feat(tablet): clamp dialogs and sheets, adaptive selection-card columns

- bottom sheets capped at 640dp via bottomSheetTheme (centered on
  wide screens, no effect on phones)
- update dialog and SAF migration dialog text capped at 480/400dp
- selection action cards and service chips grow from 2 to up to 4
  columns based on available width instead of stretching
This commit is contained in:
zarzet
2026-07-14 09:09:59 +07:00
parent a10aeb76ee
commit 8f7ede4730
7 changed files with 309 additions and 277 deletions
+17 -7
View File
@@ -14,13 +14,14 @@ class AppTheme {
// regression introduced by the Flutter upgrade. Forcing a non-predictive
// builder restores the correct back order (close modal, then pop page), at the
// cost of the predictive-back preview animation.
static const PageTransitionsTheme _pageTransitionsTheme = PageTransitionsTheme(
builders: <TargetPlatform, PageTransitionsBuilder>{
TargetPlatform.android: FadeForwardsPageTransitionsBuilder(),
TargetPlatform.iOS: CupertinoPageTransitionsBuilder(),
TargetPlatform.macOS: CupertinoPageTransitionsBuilder(),
},
);
static const PageTransitionsTheme _pageTransitionsTheme =
PageTransitionsTheme(
builders: <TargetPlatform, PageTransitionsBuilder>{
TargetPlatform.android: FadeForwardsPageTransitionsBuilder(),
TargetPlatform.iOS: CupertinoPageTransitionsBuilder(),
TargetPlatform.macOS: CupertinoPageTransitionsBuilder(),
},
);
static ThemeData light({ColorScheme? dynamicScheme, Color? seedColor}) {
final scheme =
@@ -44,6 +45,7 @@ class AppTheme {
inputDecorationTheme: _inputDecorationTheme(scheme),
listTileTheme: _listTileTheme(scheme),
dialogTheme: _dialogTheme(scheme),
bottomSheetTheme: _bottomSheetTheme,
navigationBarTheme: _navigationBarTheme(scheme),
snackBarTheme: _snackBarTheme(scheme),
progressIndicatorTheme: _progressIndicatorTheme(scheme),
@@ -81,6 +83,7 @@ class AppTheme {
inputDecorationTheme: _inputDecorationTheme(scheme),
listTileTheme: _listTileTheme(scheme),
dialogTheme: _dialogTheme(scheme),
bottomSheetTheme: _bottomSheetTheme,
navigationBarTheme: _navigationBarTheme(scheme, isAmoled: isAmoled),
snackBarTheme: _snackBarTheme(scheme),
progressIndicatorTheme: _progressIndicatorTheme(scheme),
@@ -208,6 +211,13 @@ class AppTheme {
contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 4),
);
// Caps modal sheet width on tablets/landscape (no effect on phones, whose
// screens are narrower); Flutter centers the sheet when narrower than the
// screen.
static const BottomSheetThemeData _bottomSheetTheme = BottomSheetThemeData(
constraints: BoxConstraints(maxWidth: 640),
);
static DialogThemeData _dialogTheme(ColorScheme scheme) => DialogThemeData(
elevation: 6,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(28)),