123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179 |
- import 'package:flutter/material.dart';
- import 'package:flutter_tracker/model/config.dart';
- import 'package:flutter_tracker/utils/app_util.dart';
- class SubmitPage extends StatefulWidget {
- const SubmitPage({Key key}) : super(key: key);
- @override
- _SubmitPageState createState() => _SubmitPageState();
- }
- 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
- Widget build(BuildContext context) {
- 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() {
- }
- }
|