CustomAlertDialog default BoxConstraints
This commit is contained in:
parent
deedac3497
commit
d11ae197f3
@ -561,6 +561,7 @@ class CustomAlertDialog extends StatelessWidget {
|
|||||||
required this.content,
|
required this.content,
|
||||||
this.actions,
|
this.actions,
|
||||||
this.contentPadding,
|
this.contentPadding,
|
||||||
|
this.contentBoxConstraints = const BoxConstraints(maxWidth: 500),
|
||||||
this.onSubmit,
|
this.onSubmit,
|
||||||
this.onCancel})
|
this.onCancel})
|
||||||
: super(key: key);
|
: super(key: key);
|
||||||
@ -569,6 +570,7 @@ class CustomAlertDialog extends StatelessWidget {
|
|||||||
final Widget content;
|
final Widget content;
|
||||||
final List<Widget>? actions;
|
final List<Widget>? actions;
|
||||||
final double? contentPadding;
|
final double? contentPadding;
|
||||||
|
final BoxConstraints contentBoxConstraints;
|
||||||
final Function()? onSubmit;
|
final Function()? onSubmit;
|
||||||
final Function()? onCancel;
|
final Function()? onCancel;
|
||||||
|
|
||||||
@ -600,7 +602,8 @@ class CustomAlertDialog extends StatelessWidget {
|
|||||||
title: title,
|
title: title,
|
||||||
contentPadding: EdgeInsets.symmetric(
|
contentPadding: EdgeInsets.symmetric(
|
||||||
horizontal: contentPadding ?? 25, vertical: 10),
|
horizontal: contentPadding ?? 25, vertical: 10),
|
||||||
content: content,
|
content:
|
||||||
|
ConstrainedBox(constraints: contentBoxConstraints, child: content),
|
||||||
actions: actions,
|
actions: actions,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -645,9 +648,7 @@ void msgBox(
|
|||||||
}
|
}
|
||||||
dialogManager.show((setState, close) => CustomAlertDialog(
|
dialogManager.show((setState, close) => CustomAlertDialog(
|
||||||
title: _msgBoxTitle(title),
|
title: _msgBoxTitle(title),
|
||||||
content: ConstrainedBox(
|
content: Text(translate(text), style: const TextStyle(fontSize: 15)),
|
||||||
constraints: BoxConstraints(maxWidth: 500),
|
|
||||||
child: Text(translate(text), style: const TextStyle(fontSize: 15))),
|
|
||||||
actions: buttons,
|
actions: buttons,
|
||||||
onSubmit: hasOk ? submit : null,
|
onSubmit: hasOk ? submit : null,
|
||||||
onCancel: hasCancel == true ? cancel : null,
|
onCancel: hasCancel == true ? cancel : null,
|
||||||
|
@ -570,6 +570,8 @@ class FileModel extends ChangeNotifier {
|
|||||||
Text(title)
|
Text(title)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
contentBoxConstraints:
|
||||||
|
BoxConstraints(minHeight: 100, minWidth: 400, maxWidth: 400),
|
||||||
content: Column(
|
content: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
@ -627,6 +629,8 @@ class FileModel extends ChangeNotifier {
|
|||||||
Text(title)
|
Text(title)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
contentBoxConstraints:
|
||||||
|
BoxConstraints(minHeight: 100, minWidth: 400, maxWidth: 400),
|
||||||
content: Column(
|
content: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
@ -268,6 +268,7 @@ class FfiModel with ChangeNotifier {
|
|||||||
if (isPeerAndroid) {
|
if (isPeerAndroid) {
|
||||||
_touchMode = true;
|
_touchMode = true;
|
||||||
if (parent.target != null &&
|
if (parent.target != null &&
|
||||||
|
parent.target!.connType == ConnType.defaultConn &&
|
||||||
parent.target!.ffiModel.permissions['keyboard'] != false) {
|
parent.target!.ffiModel.permissions['keyboard'] != false) {
|
||||||
Timer(
|
Timer(
|
||||||
const Duration(milliseconds: 100),
|
const Duration(milliseconds: 100),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user