Commit f11e024d authored by rizky ramadhan's avatar rizky ramadhan

validate

parent c07c7e6f
......@@ -119,6 +119,7 @@ class ContactUs2 extends StatelessWidget {
hintText: "Enter your Name",
fillColor: Colors.white,
filled: true,
errorStyle: TextStyle(color: Colors.white),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.zero,
borderSide: BorderSide(width: 1, color: Colors.white),
......@@ -130,7 +131,7 @@ class ContactUs2 extends StatelessWidget {
),
validator: (value) {
if (value == null || value.isEmpty) {
return 'Name cannot be empty!!!';
return 'Please enter your name';
}
return null;
},
......@@ -170,6 +171,7 @@ class ContactUs2 extends StatelessWidget {
hintText: "Enter a valid phone number",
fillColor: Colors.white,
filled: true,
errorStyle: TextStyle(color: Colors.white),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.zero,
borderSide:
......@@ -182,11 +184,11 @@ class ContactUs2 extends StatelessWidget {
),
),
validator: (value) {
if (value == null || value.isEmpty) {
return 'Phone cannot be empty!!!';
}
return null;
},
if (value == null || value.isEmpty) {
return 'Please enter your phone number';
}
return null;
},
),
),
const SizedBox(
......@@ -200,6 +202,7 @@ class ContactUs2 extends StatelessWidget {
hintText: "Enter a valid email address",
fillColor: Colors.white,
filled: true,
errorStyle: TextStyle(color: Colors.white),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.zero,
borderSide:
......@@ -212,11 +215,11 @@ class ContactUs2 extends StatelessWidget {
),
),
validator: (value) {
if (value == null || value.isEmpty) {
return 'Email cannot be empty!!!';
}
return null;
},
if (value == null || value.isEmpty) {
return 'Please enter your email';
}
return null;
},
),
),
const SizedBox(
......@@ -243,6 +246,7 @@ class ContactUs2 extends StatelessWidget {
hintText: "Enter your message",
fillColor: Colors.white,
filled: true,
errorStyle: TextStyle(color: Colors.white),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.zero,
borderSide: BorderSide(width: 1, color: Colors.white),
......@@ -255,7 +259,7 @@ class ContactUs2 extends StatelessWidget {
maxLines: 5,
validator: (value) {
if (value == null || value.isEmpty) {
return 'Message cannot be empty!!!';
return 'Please enter your message';
}
return null;
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment