service 2-5-26-2
This commit is contained in:
@@ -1,10 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../constant/box_name.dart';
|
||||
import '../../constant/colors.dart';
|
||||
import '../../constant/style.dart';
|
||||
import '../../main.dart';
|
||||
|
||||
class MyTextForm extends StatelessWidget {
|
||||
const MyTextForm({
|
||||
@@ -13,10 +11,12 @@ class MyTextForm extends StatelessWidget {
|
||||
required this.label,
|
||||
required this.hint,
|
||||
required this.type,
|
||||
this.validator,
|
||||
});
|
||||
final TextEditingController controller;
|
||||
final String label, hint;
|
||||
final TextInputType type;
|
||||
final String? Function(String?)? validator;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -45,8 +45,8 @@ class MyTextForm extends StatelessWidget {
|
||||
hintStyle: AppStyle.title,
|
||||
labelStyle: AppStyle.title,
|
||||
),
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
validator: validator ?? (value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return '${'Please enter'.tr} $label.'.tr;
|
||||
}
|
||||
|
||||
@@ -56,7 +56,6 @@ class MyTextForm extends StatelessWidget {
|
||||
}
|
||||
} else if (type == TextInputType.phone) {
|
||||
if (value.length > 14) {
|
||||
//for this you will return to 10 but now for service egypt
|
||||
return 'Please enter a valid phone number.'.tr;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user