import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_wallet/login/YSWalletWordKnow.dart';

import '../base/YSBase.dart';
import '../generated/l10n.dart';
import '../tools/YSColors.dart';
import '../tools/YSTools.dart';

class YSWalletKnow extends StatefulWidget {
  const YSWalletKnow({Key? key}) : super(key: key);

  @override
  YSWalletKnowState createState() => YSWalletKnowState();
}

class YSWalletKnowState extends State<YSWalletKnow> {
  final List _tipsArray = [
    {'image':'编组 61','tips':S.current.CAICHANYOUSIYAOZHUJICIKONGZHI},
    {'image':'编组 51','tips':S.current.QINGJIANGZHUJICIZHENGQUECHAOXIE},
    {'image':'编组 41','tips':S.current.QIANBAOMIMAJINYONGYUSIYAO},
    {'image':'编组 31','tips':S.current.QINGWUDUISIYAOZHUJICIJIETU}
  ];
  @override
  Widget build(BuildContext context) {
    return YSBase2(
      isScroll: false,
      ysTitle: S.current.QIANBAPXUZHI,
      ysChild: Padding(
        padding: EdgeInsets.only(top: hsp(5)),
        child: Column(
          children: [
            ClipRRect(
              borderRadius: const BorderRadius.all(Radius.circular(10)),
              child: SizedBox(
                height: hsp(150),
                width: ysWidth(context)-hsp(40),
                child: Stack(
                  children: [
                    ClipRRect(
                      borderRadius: const BorderRadius.all(Radius.circular(30)),
                      child: Image.asset(YSColors.imageStyle(context, 'WechatIMG983'),width: double.infinity,height: double.infinity,),
                    ),
                    Container(color: YSColors.shadowColor(context),),
                    // Center(
                    //   child: Image.asset(YSColors.imageStyle(context, '编组 21'),height: hsp(50),width: hsp(50),),
                    // )
                  ],
                ),
              ),
            ),
            Expanded(
                child: Padding(
                  padding: EdgeInsets.only(top: hsp(15)),
                  child: ClipRRect(
                      borderRadius: const BorderRadius.only(topLeft: Radius.circular(10),topRight: Radius.circular(10)),
                      child: Container(
                        width: ysWidth(context),
                        padding: EdgeInsets.only(top: hsp(15),bottom: hsp(15),left: 15,right: 15),
                        color: YSColors.backgroundColor(context),
                        child: Column(
                          crossAxisAlignment: CrossAxisAlignment.start,
                          children: [
                            Text(S.current.XUEXISHIPINNEIRONG,style: YSColors.contentStyle(context),),
                            ListView.separated(
                              itemBuilder: (context,index){
                                Map item = _tipsArray[index];
                                return Row(
                                  children: [
                                    Image.asset(YSColors.imageStyle(context,item['image']),height: hsp(50),width: hsp(50),),
                                    Expanded(
                                      child: Padding(
                                        padding: EdgeInsets.only(left: hsp(20)),
                                        child: Text(item['tips'],style: YSColors.contentStyle(context),),
                                      )
                                    )
                                  ],
                                );
                              },
                              separatorBuilder: (context,index){
                                return Container(height: hsp(20),);
                              },
                              itemCount: _tipsArray.length,
                              shrinkWrap: true,
                              physics: const NeverScrollableScrollPhysics(),
                              padding: EdgeInsets.only(top: hsp(20)),
                            )
                          ],
                        ),
                      )
                  ),
                )
            ),
            Container(
              padding: EdgeInsets.only(top: hsp(20),bottom: hsp(20),left: hsp(20),right: hsp(20)),
              color: YSColors.backgroundColor(context),
              child: GestureDetector(
                onTap: (){
                  Navigator.of(context).push(
                    CupertinoPageRoute(builder: (context){
                      return const YSWalletWordKnow();
                    })
                  );
                },
                child: Container(
                  height: hsp(50),
                  decoration: BoxDecoration(
                    color: YSColors.buttonColor(context),
                    borderRadius: const BorderRadius.all(Radius.circular(10)),
                  ),
                  alignment: Alignment.center,
                  child: Text(S.current.QUEREN,style: YSColors.buttonStyle(context),),
                ),
              ),
            )
          ],
        ),
      ),
    );
  }
}
