问题描述
enter image description here我想发送联系表格。但无需打开用户电子邮件即可发送。我想通过单击按钮将数据表发送到公司电子邮件。我使用了 URL-launcher,但它正在打开用户电子邮件应用程序。我怎样才能找到另一种方式?
[import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:url_launcher/url_launcher.dart';
import 'home.dart';
class Contact extends StatelessWidget {
@override
Widget build (BuildContext context) {
return MaterialApp(
home: Scaffold(
backgroundColor: Colors.black,appBar: AppBar(leading: IconButton(
icon: Icon(Icons.arrow_back,color: Colors.black),onPressed: () {
Navigator.pushReplacement(context,MaterialPageRoute(builder: (context) => Home()));
},),backgroundColor: Colors.red,title: Center(
child: Text('A-1 GUTTERS',style: TextStyle(
color: Colors.black,fontFamily: 'AbrilFatFace',fontWeight: FontWeight.bold,fontSize: 30.0,body: Column(
crossAxisAlignment: CrossAxisAlignment.center,children: <Widget>\[
SizedBox(height: 10.0),Text( 'CONTACT',style: TextStyle(
color: Colors.red,Column(
children: <Widget>\[
SizedBox(height: 15.0),TextField(
decoration: InputDecoration(
filled: true,fillColor: Colors.white,hintText: 'Name',hintStyle: TextStyle(
color: Colors.red,border: InputBorder.none,SizedBox(height: 8.0),TextField(
decoration: InputDecoration(
filled: true,hintText: 'Phone Number',hintStyle: TextStyle(
color: Colors.red,hintText: 'Email',hintStyle: TextStyle(
color: Colors.red,hintText: 'Job Address',TextField(
maxLines: 10,decoration: InputDecoration(
filled: true,hintText: 'Message',SizedBox(height: 15.0),RaisedButton(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20.0),side: BorderSide(
color: Colors.red,width: 5,color: Colors.black,onPressed: () async {
const url = 'mailto: a1gutters@comcast.net';
if (await canLaunch(url)) {
await launch(url);
} else {
throw 'Could not launch $url' ;
}
},child: Text('SUBMIT',style: TextStyle(
fontFamily: 'AbrilFatFace',fontSize: 45.0,color: Colors.red,\],)
),);
}
}][1]
如何让提交按钮在点击按钮后显示“谢谢,我们会尽快回复您”。以及如何将文本字段表单数据发送到公司电子邮件?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)