import 'package:chat/utils/CustomUI.dart';
import 'package:flutter/material.dart';

class BindAccountPage extends StatefulWidget {
  BindAccountPage({Key key}) : super(key: key);

  _BindAccountPageState createState() => _BindAccountPageState();
}

class _BindAccountPageState extends State<BindAccountPage>
    with SingleTickerProviderStateMixin {
  TabController tabCtrl;

  @override
  void initState() {
    super.initState();
  }

  @override
  void dispose() {
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: Text('绑定账号'),
          centerTitle: true,
          leading: CustomUI.buildCustomLeading(context),
        ),
        body: SafeArea(
            child: Center(
          child: Container(
            color: Colors.grey[200],
            height: MediaQuery.of(context).size.height,
            width: MediaQuery.of(context).size.width,
            child: _buildBody(),
          ),
        )));
  }

  Widget _buildBody() {
    return Column(
      children: <Widget>[
        _buildCard(),
        _buildCardList(),
      ],
    );
  }

  // Widget _buildItem() {
  //   Widget radio = new Radio(
  //       value: 0,
  //       groupValue: 0, //当value和groupValue一致的时候则选中
  //       activeColor: Colors.red,
  //       onChanged: (T) {
  //         setState(() {});
  //       });
  //   return Container(
  //     height: 60,
  //     child: Row(
  //       crossAxisAlignment: CrossAxisAlignment.center,
  //       mainAxisAlignment: MainAxisAlignment.center,
  //       children: <Widget>[
  //         Padding(
  //           padding: EdgeInsets.only(left: 25),
  //           child: Text(
  //             '小熊猫',
  //             style: TextStyle(fontWeight: FontWeight.w500),
  //           ),
  //         ),
  //         Expanded(
  //           child: Padding(
  //             padding: EdgeInsets.only(left: 60),
  //             child: Text(
  //               '134598412354698',
  //               style: TextStyle(color: Colors.grey),
  //             ),
  //           ),
  //         ),
  //         Padding(
  //           padding: EdgeInsets.only(right: 10),
  //           child: radio,
  //         ),
  //       ],
  //     ),
  //   );
  // }

  Widget _buildCardList() {
    return Container(
      color: Colors.white,
      width: double.infinity,
      child: Column(
        children: <Widget>[
          //_buildItem(),
          // _buildDivider(),
          // _buildItem(),
        ],
      ),
    );
  }

  Widget _buildCard() {
    return InkWell(
        onTap: () {
          // Navigator.of(context).push(
          //   new MaterialPageRoute(
          //     builder: (context) {
          //       return BindBankPage(isBind: ,);
          //     },
          //   ),
          // );
        },
        child: Container(
          margin: EdgeInsets.only(top: 20, bottom: 30),
          width: MediaQuery.of(context).size.width * 0.92,
          decoration: BoxDecoration(
              color: const Color(0xFF2172FF),
              boxShadow: [
                BoxShadow(
                  color: const Color(0xA80ECFFF),
                  blurRadius: 8,
                )
              ],
              borderRadius: BorderRadius.all(Radius.circular(5))),
          child: Column(
            children: <Widget>[
              Container(
                margin: EdgeInsets.only(top: 10),
                child: Text('+',
                    textScaleFactor: 1.0,
                    style: TextStyle(
                        color: Colors.white,
                        fontSize: 55,
                        fontWeight: FontWeight.w700)),
              ),
              Container(
                  padding: EdgeInsets.only(right: 10),
                  height: 30,
                  child: Text(
                    '添加银行卡',
                    textScaleFactor: 1.0,
                    style: TextStyle(color: Colors.white, fontSize: 14),
                  ))
            ],
          ),
        ));
  }
}
