Skip to content

Commit 06c8558

Browse files
committed
feat: add support for small phone detection
1 parent 6c1352d commit 06c8558

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

lib/core/dialog/default_dialog.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ class DefaultDialog extends StatelessWidget {
124124
return material.Dialog(
125125
elevation: 0,
126126
backgroundColor: Colors.transparent,
127+
insetPadding: context.isPhoneSmall ? context.paddingL_0 : context.paddingXXL_0,
127128
child: Container(
128129
constraints: BoxConstraints(
129130
maxWidth: context.dimensions.dialogMaxWidth(context)

lib/extended_theme/extensions/context_extension.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,10 @@ extension ContextExtension on BuildContext {
129129
bool get isPhoneApp => !kIsWeb && (Platform.isIOS || Platform.isAndroid) && MediaQuery.of(this).size.shortestSide < _tabletSmallestWidthThreshold;
130130
bool get isPhoneWeb => kIsWeb && (defaultTargetPlatform == TargetPlatform.iOS || defaultTargetPlatform == TargetPlatform.android) && MediaQuery.of(this).size.shortestSide < _tabletSmallestWidthThreshold;
131131

132+
133+
bool get isPhoneSmall => isPhone && MediaQuery.of(this).size.shortestSide < 350.0;
134+
135+
132136
bool get isPortableDevice => isPortableDeviceApp || isPortableDeviceWeb;
133137
bool get isPortableDeviceApp => !kIsWeb && (Platform.isIOS || Platform.isAndroid);
134138
bool get isPortableDeviceWeb => kIsWeb && (defaultTargetPlatform == TargetPlatform.iOS || defaultTargetPlatform == TargetPlatform.android);

0 commit comments

Comments
 (0)