import 'package:autosos_flutter/util/xhttp.dart';
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';

class LoginPage extends StatefulWidget {
  const LoginPage({super.key});

  @override
  State<LoginPage> createState() => _LoginPageState();
}

class _LoginPageState extends State<LoginPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(),
      body: Column(
        children: [
          ListTile(
            leading: Image.asset(
              "images/1.5x/ic_launcher.png",
              height: 54,
              width: 54,
            ),
            title: const Text(
              "欢迎登陆啾啾救援",
              style: TextStyle(fontSize: 23, fontWeight: FontWeight.bold),
            ),
            subtitle: const Text(
              "宁波易到互联科技有限公司",
              style: TextStyle(
                fontSize: 13,
              ),
            ),
          ),
          Padding(
            padding: const EdgeInsets.all(20),
            child: Row(
              children: [
                const Text(
                  "+86",
                  style: TextStyle(fontSize: 16, color: Color(0xFF1D1D1D)),
                ),
                Padding(
                  padding: const EdgeInsets.all(15),
                  child: Container(
                    height: 20,
                    width: 1,
                    color: Colors.grey,
                  ),
                ),
                const Expanded(
                    child: TextField(
                      decoration: InputDecoration(hintText: "请输入手机号"),
                    )),
              ],
            ),
          ),
          const Padding(
            padding: EdgeInsets.all(20),
            child: Row(
              children: [
                Expanded(
                    child: TextField(
                      decoration: InputDecoration(hintText: "请输入密码"),
                    ))
              ],
            ),
          ),
          Padding(
              padding: const EdgeInsets.all(20),
              child: GestureDetector(
                  onTap:()=>_login(),
                  child: Container(
                  padding: const EdgeInsets.all(12),
                  margin: const EdgeInsets.only(top: 40),
                  width: MediaQuery
                      .of(context)
                      .size
                      .width,
                  decoration: BoxDecoration(color: Colors.grey,
                      borderRadius: BorderRadius.circular(21)),
                  child: const Center(
                      child: Text(
                        "登录",
                        style: TextStyle(
                            fontSize: 18, fontWeight: FontWeight.bold),
                      ))),)
          )
        ],
      ),
    );
  }

  void _login() async{

  }
}
