Commit 37c031b2 authored by qorri_di's avatar qorri_di

contact_us2.dart

small_contact_us2.dart
parent f0b71929
...@@ -252,13 +252,13 @@ class ContactUs2 extends StatelessWidget { ...@@ -252,13 +252,13 @@ class ContactUs2 extends StatelessWidget {
child: TextButton( child: TextButton(
style: Btn_Submit(), style: Btn_Submit(),
onPressed: () async { onPressed: () async {
if (_formKey.currentState!.validate()) { savecontact(
final response = await SendEmail(
nameController.value.text, nameController.value.text,
emailController.value.text, emailController.value.text,
phoneController.value.text, phoneController.value.text,
messageController.value.text); messageController.value.text);
savecontact( if (_formKey.currentState!.validate()) {
final response = await sendEmail(
nameController.value.text, nameController.value.text,
emailController.value.text, emailController.value.text,
phoneController.value.text, phoneController.value.text,
...@@ -297,7 +297,7 @@ class ContactUs2 extends StatelessWidget { ...@@ -297,7 +297,7 @@ class ContactUs2 extends StatelessWidget {
); );
} }
Future SendEmail( Future sendEmail(
String name, String phone, String email, String message) async { String name, String phone, String email, String message) async {
final url = Uri.parse('https://api.emailjs.com/api/v1.0/email/send'); final url = Uri.parse('https://api.emailjs.com/api/v1.0/email/send');
const serviceId = 'service_7wwup8c'; const serviceId = 'service_7wwup8c';
......
...@@ -233,6 +233,11 @@ class _ContactUs2_smallState extends State<ContactUs2_small> { ...@@ -233,6 +233,11 @@ class _ContactUs2_smallState extends State<ContactUs2_small> {
child: TextButton( child: TextButton(
style: Btn_Submit(), style: Btn_Submit(),
onPressed: () async { onPressed: () async {
savecontact(
nameController.value.text,
emailController.value.text,
phoneController.value.text,
messageController.value.text);
if (_formKey.currentState!.validate()) { if (_formKey.currentState!.validate()) {
final response = await SendEmail( final response = await SendEmail(
nameController.value.text, nameController.value.text,
......
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