
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:liftmanager/res/resources.dart';
import 'package:liftmanager/utils/image_utils.dart';
import 'package:liftmanager/widgets/app_bar.dart';
import 'package:liftmanager/widgets/click_item.dart';

class TeamUserDetailPage extends StatefulWidget{
  final String name;
  final String remark;
  final String role;
  final String logoImg;
  final String isCertificated;
  final String certificateType;
  final String expirationDate;
  final String issuanceAgency;
  TeamUserDetailPage(this.name,this.remark,this.role,this.logoImg,this.isCertificated,this.certificateType,this.expirationDate,this.issuanceAgency);
  @override
  State<StatefulWidget> createState() {
    return TeamUserDetailPageState();
  }

}

class TeamUserDetailPageState extends State<TeamUserDetailPage>{
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        body: ListView(padding: EdgeInsets.all(0.0), children: <Widget>[
          Stack(
            children: <Widget>[
              Image.asset("assets/images/wode/bg_header.png"),
              Positioned(
                left: 0,
                right: 0,
                top: 0,
                child: MyAppBar(
                  backgroundColor: Colors.transparent,
                  isBack: true,
                  centerTitle: "成员详情",
                ),
              ),
              Positioned(
                  top: 96,
                  left: 15,
                  child: Row(
                    children: <Widget>[
                      CircleAvatar(
                          radius: 30.0,
                          backgroundColor: Colors.transparent,
                          backgroundImage: ImageUtils.getImageProvider(
                              widget.logoImg)),
                      Gaps.hGap10,
                      Column(
                        children: <Widget>[
                          Text("${widget.name}",style: TextStyle(color: Colors.white,fontSize: 15),),
                          Text("简介：${widget.remark}",style: TextStyle(color: Colors.white,fontSize: 12),),
                        ],
                      ),
                      Gaps.hGap8,
                      Container(
                        height: 16,
                        padding: EdgeInsets.only(left: 5,right: 5),
                        decoration: BoxDecoration(
                          color: Colors.white,
                          borderRadius: BorderRadius.circular(10),
                        ),
                        child: Text("${widget.role}",style: TextStyle(fontSize: 10,color: Color(0xFF01AFFF)),),
                      )
                    ],
                  )),
//        ‘0 未认证 1 已认证 2 审核中 3 认证失败’
            ],
          ),
          ClickItem(title: "操作证", content: "${widget.isCertificated == "1"?"合格":"不合格"}"),
          ClickItem(title: "操作证类型", content: "${widget.certificateType}"),
          ClickItem(title: "证件有效期", content: "${widget.expirationDate}"),
          ClickItem(title: "发证单位", content: "${widget.issuanceAgency}"),

        ]));
  }
}