Closed ozayr closed 3 days ago
Hi @ozayr,
Yes it is possible. You just need to create your own modal type. Here you need to override only layoutModal
.
class _MyModalDialog extends WoltModalType {
@override
BoxConstraints layoutModal(Size availableSize) {
final availableWidth = availableSize.width;
double width = availableWidth > 523.0 ? 312.0 : availableWidth - padding.end;
return BoxConstraints(
minWidth: width,
maxWidth: width,
minHeight: 0,
maxHeight: availableSize.height * 0.6,
);
}
}
Then, when you are calling your modal:
WoltModalSheet.show(
context: context,
modalTypeBuilder: (BuildContext context) {
final width = MediaQuery.sizeOf(context).width;
if (width < 523) {
return WoltModalType.bottomSheet();
} else {
return _MyModalDialog();
},
...
},
Please let me know if this works!
@ozayr Please re-open this issue if this does not answer your request.
is there a way or property to just make the modal width bigger without extending or overriding as it was before with maxdialogwidth ?