Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/flutter/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Forms “你如何阻止一次骚动?”;表格「;从投掷错误?_Forms_Flutter_Dart_Visual Studio Code_Flutter Web - Fatal编程技术网

Forms “你如何阻止一次骚动?”;表格「;从投掷错误?

Forms “你如何阻止一次骚动?”;表格「;从投掷错误?,forms,flutter,dart,visual-studio-code,flutter-web,Forms,Flutter,Dart,Visual Studio Code,Flutter Web,在我的个人网站上工作,我想添加一个联系表格,这样网站上的任何人都可以填写一个简单的表格,网站会给我发送一封电子邮件。我想我已经弄明白了电子邮件的部分,但是用户必须填写的表单还不起作用 每当我开始调试代码时,它就会加载到我的主页上。我点击右上角的“联系我”,它会像预期的那样将我带到表单页面,但它会立即显示出来 下面是我的联系人表单.dart文件全文: 导入“包装:颤振/材料.省道”; 导入“package:flatter_email_sender/flatter_email_sender.dart

在我的个人网站上工作,我想添加一个联系表格,这样网站上的任何人都可以填写一个简单的表格,网站会给我发送一封电子邮件。我想我已经弄明白了电子邮件的部分,但是用户必须填写的表单还不起作用

每当我开始调试代码时,它就会加载到我的主页上。我点击右上角的“联系我”,它会像预期的那样将我带到表单页面,但它会立即显示出来

下面是我的
联系人表单.dart
文件全文:

导入“包装:颤振/材料.省道”;
导入“package:flatter_email_sender/flatter_email_sender.dart”;
导入“package:google_fonts/google_fonts.dart”;
导入“../extensions/email_detection_extension.dart”;
导入“../extensions/hover_extensions.dart”;
类ContactForm扩展了StatefulWidget{
const ContactForm({Key}):super(Key:Key);
@凌驾
_ContactFormState createState()=>\u ContactFormState();
}
类_ContactFormState扩展状态{
静态常量bool _autovalidate=false;
final _formKey=GlobalKey();
final _nameController=TextEditingController();
final _emailController=TextEditingController();
final _messageController=TextEditingController();
@凌驾
小部件构建(构建上下文){
报税表(
键:_formKey,
自动验证:\ u autovalidate,//正如您所看到的,我禁用了自动验证,所以不应该是这样
子:ListView(
儿童:[
划船(
儿童:[
正文(
“名称:”,
风格:GoogleFonts.ubuntu(
尺码:18,
fontWeight:fontWeight.w500,
身高:1.7,
颜色:颜色,白色,
),
),
尺寸箱(宽度:10),
大小盒子(
子项:TextFormField(
验证器:(值){
如果(value.isEmpty)返回“此字段是必需的”;
返回null;
},
装饰:输入装饰(
hintText:“最后一个”,
hintStyle:GoogleFonts.ubuntu(
尺码:18,
fontWeight:fontWeight.w500,
身高:1.7,
颜色:颜色,白色,
),
enabledBorder:const UnderlineInputBorder(
borderSide:const borderSide(颜色:color.fromARGB(255、220、220、220))
),
focusedBorder:const大纲输入框(
borderSide:const borderSide(颜色:color.fromARGB(255、220、220、220))
),
fillColor:Color.fromARGB(255、255、255、255),
聚焦颜色:来自argb(50、150、50、200)的颜色,
errorText:'此字段是必需的。'
),
控制器:\u name控制器
),
宽度:500
)
]
),
划船(
儿童:[
正文(
“电子邮件:”,
风格:GoogleFonts.ubuntu(
尺码:18,
fontWeight:fontWeight.w500,
身高:1.7,
颜色:颜色,白色,
),
),
尺寸箱(宽度:10),
大小盒子(
子项:TextFormField(
验证器:(值){
如果(!value.isValidEmail())返回“此字段是必需的,并且必须采用以下格式”example@website.abc".';
返回null;
},
装饰:输入装饰(
hintText:'example@website.abc',
hintStyle:GoogleFonts.ubuntu(
尺码:18,
fontWeight:fontWeight.w500,
身高:1.7,
颜色:颜色,白色,
),
enabledBorder:const UnderlineInputBorder(
borderSide:const borderSide(颜色:color.fromARGB(255、220、220、220))
),
focusedBorder:const大纲输入框(
borderSide:const borderSide(颜色:color.fromARGB(255、220、220、220))
),
fillColor:Color.fromARGB(255、255、255、255),
聚焦颜色:来自argb(50、150、50、200)的颜色,
errorText:'此字段是必填字段,必须采用以下格式'example@website.abc".'
),
控制器:\u电子邮件控制器,
键盘类型:TextInputType.emailAddress,
),
宽度:500
)
]
),
划船(
儿童:[
正文(
“消息:”,
风格:GoogleFonts.ubuntu(
尺码:18,
fontWeight:fontWeight.w500,
身高:1.7,
颜色:颜色,白色,
),
),
尺寸箱(宽度:10),
大小盒子(
子项:TextFormField(
验证器:(值){
如果(!value.isValidEmail())返回“此字段是必需的”;
返回null;
},
装饰:输入装饰(
hintText:'消息',
hintStyle:GoogleFonts.ubuntu(
尺码:18,
fontWeight:fontWeight.w500,
身高:1.7,
颜色:颜色,白色,
),
enabledBorder:const UnderlineInputBorder(
borderSide:const borderSide(颜色:color.fromARGB(255、220、220、220)