|
@@ -1,4 +1,6 @@
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
+import 'package:flutter_tracker/model/config.dart';
|
|
|
|
+import 'package:flutter_tracker/utils/app_util.dart';
|
|
|
|
|
|
class SubmitPage extends StatefulWidget {
|
|
class SubmitPage extends StatefulWidget {
|
|
const SubmitPage({Key key}) : super(key: key);
|
|
const SubmitPage({Key key}) : super(key: key);
|
|
@@ -8,8 +10,170 @@ class SubmitPage extends StatefulWidget {
|
|
}
|
|
}
|
|
|
|
|
|
class _SubmitPageState extends State<SubmitPage> {
|
|
class _SubmitPageState extends State<SubmitPage> {
|
|
|
|
+ Size get _size => MediaQuery.of(context).size;
|
|
|
|
+ final TextEditingController _controllerUsn = TextEditingController();
|
|
|
|
+ final TextEditingController _controllerTel = TextEditingController();
|
|
|
|
+ final TextEditingController _controllerAddress = TextEditingController();
|
|
|
|
+ final GlobalKey _formKey = GlobalKey<FormState>();
|
|
|
|
+
|
|
|
|
+ String _userName = "";
|
|
|
|
+ String _tel = "";
|
|
|
|
+ String _addresds = "";
|
|
|
|
+
|
|
@override
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
Widget build(BuildContext context) {
|
|
- return Container();
|
|
|
|
|
|
+ return Scaffold(
|
|
|
|
+ appBar: AppBar(
|
|
|
|
+ title: Text("疫情上报"),
|
|
|
|
+ ),
|
|
|
|
+ body: SizedBox(
|
|
|
|
+ width: _size.width,
|
|
|
|
+ child: SingleChildScrollView(
|
|
|
|
+ child: Padding(
|
|
|
|
+ padding:
|
|
|
|
+ const EdgeInsets.symmetric(vertical: 16.0, horizontal: 24.0),
|
|
|
|
+ child: Column(
|
|
|
|
+ children: [
|
|
|
|
+ TextFormField(
|
|
|
|
+ autofocus: true,
|
|
|
|
+ controller: _controllerUsn,
|
|
|
|
+ decoration: const InputDecoration(
|
|
|
|
+ labelText: "姓名:",
|
|
|
|
+ hintText: "请输入真实姓名",
|
|
|
|
+ icon: Icon(Icons.person)),
|
|
|
|
+ // 校验用户名
|
|
|
|
+ validator: (v) {
|
|
|
|
+ return v.trim().length > 0 ? null : "姓名不能为空";
|
|
|
|
+ },
|
|
|
|
+ onChanged: (inputStr) {
|
|
|
|
+ _userName = inputStr;
|
|
|
|
+ },
|
|
|
|
+ ),
|
|
|
|
+ TextFormField(
|
|
|
|
+ controller: _controllerTel,
|
|
|
|
+ decoration: const InputDecoration(
|
|
|
|
+ labelText: "电话:",
|
|
|
|
+ hintText: "联系电话",
|
|
|
|
+ icon: Icon(Icons.phone)),
|
|
|
|
+ validator: (v) {
|
|
|
|
+ return v.trim().length > 11 ? null : "手机号错误";
|
|
|
|
+ },
|
|
|
|
+ onChanged: (inputStr) {
|
|
|
|
+ _tel = inputStr;
|
|
|
|
+ },
|
|
|
|
+ ),
|
|
|
|
+ TextFormField(
|
|
|
|
+ controller: _controllerAddress,
|
|
|
|
+ decoration: const InputDecoration(
|
|
|
|
+ labelText: "住址:",
|
|
|
|
+ hintText: "请输入家庭住址",
|
|
|
|
+ icon: Icon(Icons.house)),
|
|
|
|
+ validator: (v) {
|
|
|
|
+ return v.trim().length > 0 ? null : "请输入地址";
|
|
|
|
+ },
|
|
|
|
+ onChanged: (inputStr) {
|
|
|
|
+ _addresds = inputStr;
|
|
|
|
+ },
|
|
|
|
+ ),
|
|
|
|
+ SizedBox(
|
|
|
|
+ height: 10,
|
|
|
|
+ ),
|
|
|
|
+ Align(
|
|
|
|
+ child: Text(
|
|
|
|
+ "健康状态:",
|
|
|
|
+ style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
|
|
|
|
+ ),
|
|
|
|
+ alignment: Alignment.centerLeft,
|
|
|
|
+ ),
|
|
|
|
+ Row(
|
|
|
|
+ children: [
|
|
|
|
+ RadioListTile(
|
|
|
|
+ title: Text("阴性"),
|
|
|
|
+ value: 0,
|
|
|
|
+ groupValue: 0,
|
|
|
|
+ onChanged: (value) {},
|
|
|
|
+ ),
|
|
|
|
+ RadioListTile(
|
|
|
|
+ title: Text("阳性"),
|
|
|
|
+ value: 1,
|
|
|
|
+ groupValue: 0,
|
|
|
|
+ onChanged: (value) {},
|
|
|
|
+ ),
|
|
|
|
+ ],
|
|
|
|
+ ),
|
|
|
|
+ SizedBox(
|
|
|
|
+ height: 10,
|
|
|
|
+ ),
|
|
|
|
+ Align(
|
|
|
|
+ child: Text(
|
|
|
|
+ "核酸检测:",
|
|
|
|
+ style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
|
|
|
|
+ ),
|
|
|
|
+ alignment: Alignment.centerLeft,
|
|
|
|
+ ),
|
|
|
|
+ Text("请拍照上传清晰的核酸证明图片"),
|
|
|
|
+ InkWell(
|
|
|
|
+ onTap: () {
|
|
|
|
+ chooseImg();
|
|
|
|
+ },
|
|
|
|
+ child: Container(
|
|
|
|
+ child: Image.asset(
|
|
|
|
+ "assets/images/add.png",
|
|
|
|
+ width: 160,
|
|
|
|
+ height: 160,
|
|
|
|
+ ),
|
|
|
|
+ ),
|
|
|
|
+ ),
|
|
|
|
+ SizedBox(
|
|
|
|
+ height: 10,
|
|
|
|
+ ),
|
|
|
|
+ Container(
|
|
|
|
+ width: 150,
|
|
|
|
+ child: InkWell(
|
|
|
|
+ onTap: () {
|
|
|
|
+ // 登录
|
|
|
|
+ submitInfo();
|
|
|
|
+ },
|
|
|
|
+ child: Container(
|
|
|
|
+ width: double.infinity,
|
|
|
|
+ height: AppUtil.height(80),
|
|
|
|
+ padding: EdgeInsets.only(
|
|
|
|
+ right: AppUtil.width(20), left: AppUtil.width(20)),
|
|
|
|
+ decoration: BoxDecoration(
|
|
|
|
+ gradient: const LinearGradient(colors: [
|
|
|
|
+ ThemeColor.loignColor,
|
|
|
|
+ ThemeColor.loignColor
|
|
|
|
+ ]),
|
|
|
|
+ borderRadius: BorderRadius.circular(10),
|
|
|
|
+ boxShadow: const [
|
|
|
|
+ BoxShadow(
|
|
|
|
+ offset: Offset(1.0, 5.0),
|
|
|
|
+ color: ThemeColor.loignColor,
|
|
|
|
+ blurRadius: 5.0,
|
|
|
|
+ )
|
|
|
|
+ ]),
|
|
|
|
+ child: const Center(
|
|
|
|
+ child: Text(
|
|
|
|
+ "登录",
|
|
|
|
+ style: TextStyle(fontSize: 20, color: Colors.white),
|
|
|
|
+ ),
|
|
|
|
+ ),
|
|
|
|
+ ),
|
|
|
|
+ ),
|
|
|
|
+ ),
|
|
|
|
+ ],
|
|
|
|
+ ),
|
|
|
|
+ ),
|
|
|
|
+ ),
|
|
|
|
+ ),
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ void submitInfo() {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ void chooseImg() {
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|