showTextFieldDialog static method
void
showTextFieldDialog({
- String? text,
- ValueChanged<
String> ? onConfirm, - VoidCallback? onCancel,
Implementation
static void showTextFieldDialog({String? text,ValueChanged<String>? onConfirm,VoidCallback? onCancel}){
TextEditingController controller = TextEditingController(text: text);
Get.defaultDialog(
title: '提示',
titleStyle: const TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold
),
radius: 12,
backgroundColor: Colors.white,
content: TextField(controller: controller),
textCancel: '取消',
textConfirm: '确定',
confirmTextColor: Colors.white,
onConfirm: (){
onConfirm?.call(controller.text);
Get.back();
},
onCancel: (){
onCancel?.call();
}
);
}