Commit 97acc590 authored by Ade Fikriatul  Ilmi's avatar Ade Fikriatul Ilmi

menambahkan kondisi no hp

parent 6e6511ba
......@@ -18,6 +18,9 @@ class ContactUs2 extends StatelessWidget {
final emailController = TextEditingController();
final messageController = TextEditingController();
String pattern =
r'(\+62|62|0)(\d{2,3})?\)?[ .-]?\d{2,4}[ .-]?\d{2,4}[ .-]?\d{2,4}';
@override
Widget build(BuildContext context) {
var screenSize = MediaQuery.of(context).size;
......@@ -186,6 +189,8 @@ class ContactUs2 extends StatelessWidget {
validator: (value) {
if (value == null || value.isEmpty) {
return 'Please enter your phone number';
} else if (!RegExp(pattern).hasMatch(value)) {
return 'Start with 628 or 08';
}
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