open<T> static method
弹出选择框
Implementation
static Future<T?> open<T>(
T? initialValue, {
Widget? title,
required List<TdCascaderItem<T>> options,
}) {
final completer = Completer<T>();
TdPopupPlugin.open(
builder: (context) {
return Column(
mainAxisSize: MainAxisSize.min,
children: [
TdPopupAppbar.close(
title: title,
onClosing: () {
TdPopupPlugin.pop();
completer.complete();
},
),
TdCascader<T>(
title: title,
initialValue: initialValue,
onChanged: (value) {
TdPopupPlugin.pop();
completer.complete(value);
},
children: options,
),
],
);
},
);
return completer.future;
}