微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

单击按钮颤动后如何将文本字段数据发送到电子邮件

如何解决单击按钮颤动后如何将文本字段数据发送到电子邮件

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 举报,一经查实,本站将立刻删除。