showSingleTextInput static method
显示单个文本输入框弹窗
Implementation
static Future<String> showSingleTextInput({
String title = 'Title',
String message = '',
String initialText = '',
String hintText = '',
String cancelLabelText = 'Cancel',
String okLabelText = 'OK',
}) async {
final texts = await showTextInputDialog(
context: Get.context!,
title: title,
message: message.isNotEmpty ? message : null,
textFields: [
DialogTextField(
initialText: initialText,
hintText: hintText,
),
],
);
return texts != null && texts.isNotEmpty ? texts[0] : '';
}