@@ -278,6 +278,12 @@ class FDialog extends StatefulWidget {
278278 /// The dialog's box constraints. Defaults to `BoxConstraints(minWidth: 280, maxWidth: 560)` .
279279 final BoxConstraints constraints;
280280
281+ /// Whether the dialog should avoid the system's view insets, typically the keyboard. Defaults to true.
282+ ///
283+ /// Set this to false to avoid the dialog from becoming overly compressed on web & embedded platforms where the view
284+ /// insets comes from the surrounding host/browser environment.
285+ final bool resizeToAvoidInsets;
286+
281287 /// The builder for the dialog's content.
282288 final Widget Function (BuildContext context, FDialogStyle style) builder;
283289
@@ -322,6 +328,7 @@ class FDialog extends StatefulWidget {
322328 this .animation,
323329 this .semanticsLabel,
324330 this .constraints = const BoxConstraints (minWidth: 280 , maxWidth: 560 ),
331+ this .resizeToAvoidInsets = true ,
325332 Widget ? image,
326333 Widget ? title,
327334 Widget ? body,
@@ -359,6 +366,7 @@ class FDialog extends StatefulWidget {
359366 this .animation,
360367 this .semanticsLabel,
361368 this .constraints = const BoxConstraints (minWidth: 280 , maxWidth: 560 ),
369+ this .resizeToAvoidInsets = true ,
362370 Widget ? image,
363371 Widget ? title,
364372 Widget ? body,
@@ -391,6 +399,7 @@ class FDialog extends StatefulWidget {
391399 this .animation,
392400 this .semanticsLabel,
393401 this .constraints = const BoxConstraints (minWidth: 280 , maxWidth: 560 ),
402+ this .resizeToAvoidInsets = true ,
394403 super .key,
395404 });
396405
@@ -405,6 +414,7 @@ class FDialog extends StatefulWidget {
405414 ..add (DiagnosticsProperty ('animation' , animation))
406415 ..add (StringProperty ('semanticsLabel' , semanticsLabel))
407416 ..add (DiagnosticsProperty ('constraints' , constraints))
417+ ..add (FlagProperty ('resizeToAvoidInsets' , value: resizeToAvoidInsets, ifFalse: 'do not resize for view insets' ))
408418 ..add (ObjectFlagProperty .has ('builder' , builder));
409419 }
410420}
@@ -490,7 +500,9 @@ class _FDialogState extends State<FDialog> {
490500 }
491501
492502 return AnimatedPadding (
493- padding: MediaQuery .viewInsetsOf (context) + style.insetPadding.resolve (direction),
503+ padding:
504+ (widget.resizeToAvoidInsets ? MediaQuery .viewInsetsOf (context) : EdgeInsets .zero) +
505+ style.insetPadding.resolve (direction),
494506 duration: style.motion.insetDuration,
495507 curve: style.motion.insetCurve,
496508 child: MediaQuery .removeViewInsets (
0 commit comments