showColumn<T> method
Future<T?>
showColumn<T>({
- required UpdableBuilder onContent,
- UpdableBuilder? onTitle,
- UpdableBuilder? onActions,
- bool onOK()?,
- String? title,
- bool ok = false,
- bool cancel = false,
- bool isContentScrollable = false,
- EdgeInsets padding = const EdgeInsets.symmetric(vertical: 16, horizontal: 12),
- List<
Widget> ? aboveWidgets, - List<
Widget> ? belowWidgets,
Implementation
Future<T?> showColumn<T>({
required UpdableBuilder onContent,
UpdableBuilder? onTitle,
UpdableBuilder? onActions,
bool Function(UpdatableContext)? onOK,
String? title,
bool ok = false,
bool cancel = false,
bool isContentScrollable = false,
EdgeInsets padding = const EdgeInsets.symmetric(vertical: 16, horizontal: 12),
List<Widget>? aboveWidgets,
List<Widget>? belowWidgets,
}) {
return showBuilder((uc) {
uc.onValidate = () {
return onOK?.call(uc) ?? true;
};
Widget c = onContent(uc).padded(padding).constrainedBox(minWidth: CONTENT_MIN_WIDTH, minHeight: CONTENT_MIN_HEIGHT);
return ColumnMinStretch([
if (onTitle != null) onTitle(uc),
if (onTitle == null && title != null) titlePanel(uc, title: title.text()),
...?aboveWidgets,
if (isContentScrollable) c.flexible() else c,
...?belowWidgets,
if (onActions != null) onActions(uc),
if (onActions == null && (ok || cancel)) actionPanel(uc, [if (cancel) cancelAction("取消"), if (ok) okAction(uc, "确定")]),
]).constrainedBox(minHeight: 80);
});
}