Перевёл виджеты ввода
This commit is contained in:
parent
10ac93eeb6
commit
1051ac57e0
1 changed files with 13 additions and 13 deletions
|
|
@ -6,7 +6,7 @@ Future<String?> showStringInputDialog({String? originalValue}) async {
|
||||||
final strVal = (originalValue ?? "").obs;
|
final strVal = (originalValue ?? "").obs;
|
||||||
return await Get.dialog<String>(
|
return await Get.dialog<String>(
|
||||||
AlertDialog(
|
AlertDialog(
|
||||||
title: const Text("Enter a string"),
|
title: const Text("Введите строку"),
|
||||||
content: TextField(
|
content: TextField(
|
||||||
controller: TextEditingController(text: originalValue),
|
controller: TextEditingController(text: originalValue),
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
|
|
@ -18,13 +18,13 @@ Future<String?> showStringInputDialog({String? originalValue}) async {
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Get.back(result: null);
|
Get.back(result: null);
|
||||||
},
|
},
|
||||||
child: const Text("Cancel"),
|
child: const Text("Отменить"),
|
||||||
),
|
),
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Get.back(result: strVal.value);
|
Get.back(result: strVal.value);
|
||||||
},
|
},
|
||||||
child: const Text("OK"),
|
child: const Text("Ок"),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
@ -35,7 +35,7 @@ Future<double?> showDoubleInputDialog({double? originalValue}) async {
|
||||||
final strVal = (originalValue?.toString() ?? "").obs;
|
final strVal = (originalValue?.toString() ?? "").obs;
|
||||||
return await Get.dialog<double>(
|
return await Get.dialog<double>(
|
||||||
AlertDialog(
|
AlertDialog(
|
||||||
title: const Text("Enter a number"),
|
title: const Text("Введите плавающее число"),
|
||||||
content: FastTextField(
|
content: FastTextField(
|
||||||
name: "Number",
|
name: "Number",
|
||||||
initialValue: originalValue?.toString(),
|
initialValue: originalValue?.toString(),
|
||||||
|
|
@ -43,11 +43,11 @@ Future<double?> showDoubleInputDialog({double? originalValue}) async {
|
||||||
autovalidateMode: AutovalidateMode.onUserInteraction,
|
autovalidateMode: AutovalidateMode.onUserInteraction,
|
||||||
validator: (value) {
|
validator: (value) {
|
||||||
if (value == null || value.isEmpty) {
|
if (value == null || value.isEmpty) {
|
||||||
return "Please enter a number";
|
return "Пожалуйста, введите плавающее число";
|
||||||
}
|
}
|
||||||
final parsed = double.tryParse(value);
|
final parsed = double.tryParse(value);
|
||||||
if (parsed == null) {
|
if (parsed == null) {
|
||||||
return "Please enter a valid number";
|
return "Пожалуйста, введите настоящее плавающее число";
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
|
|
@ -60,7 +60,7 @@ Future<double?> showDoubleInputDialog({double? originalValue}) async {
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Get.back(result: null);
|
Get.back(result: null);
|
||||||
},
|
},
|
||||||
child: const Text("Cancel"),
|
child: const Text("Отменить"),
|
||||||
),
|
),
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
|
|
@ -71,7 +71,7 @@ Future<double?> showDoubleInputDialog({double? originalValue}) async {
|
||||||
Get.back(result: null);
|
Get.back(result: null);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: const Text("OK"),
|
child: const Text("Ок"),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
@ -82,7 +82,7 @@ Future<int?> showIntInputDialog({int? originalValue}) async {
|
||||||
final strVal = (originalValue?.toString() ?? "").obs;
|
final strVal = (originalValue?.toString() ?? "").obs;
|
||||||
return await Get.dialog<int>(
|
return await Get.dialog<int>(
|
||||||
AlertDialog(
|
AlertDialog(
|
||||||
title: const Text("Enter a number"),
|
title: const Text("Введите целое число"),
|
||||||
content: FastTextField(
|
content: FastTextField(
|
||||||
name: "Number",
|
name: "Number",
|
||||||
initialValue: originalValue?.toString(),
|
initialValue: originalValue?.toString(),
|
||||||
|
|
@ -90,11 +90,11 @@ Future<int?> showIntInputDialog({int? originalValue}) async {
|
||||||
autovalidateMode: AutovalidateMode.onUserInteraction,
|
autovalidateMode: AutovalidateMode.onUserInteraction,
|
||||||
validator: (value) {
|
validator: (value) {
|
||||||
if (value == null || value.isEmpty) {
|
if (value == null || value.isEmpty) {
|
||||||
return "Please enter a number";
|
return "Пожалуйста, введите целое число";
|
||||||
}
|
}
|
||||||
final parsed = int.tryParse(value);
|
final parsed = int.tryParse(value);
|
||||||
if (parsed == null) {
|
if (parsed == null) {
|
||||||
return "Please enter a valid number";
|
return "Пожалуйста, введите настоящее целое число";
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
|
|
@ -107,7 +107,7 @@ Future<int?> showIntInputDialog({int? originalValue}) async {
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Get.back(result: null);
|
Get.back(result: null);
|
||||||
},
|
},
|
||||||
child: const Text("Cancel"),
|
child: const Text("Отменить"),
|
||||||
),
|
),
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
|
|
@ -118,7 +118,7 @@ Future<int?> showIntInputDialog({int? originalValue}) async {
|
||||||
Get.back(result: null);
|
Get.back(result: null);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: const Text("OK"),
|
child: const Text("Ок"),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue