import 'package:flutter/material.dart';
import 'package:flutter_wallet/generated/l10n.dart';

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

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

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

class YSSettingThemState extends State<YSSettingThem> {
  final List _list = [
    {'title':S.current.HEIYE,'type':'dart'},
    {'title':S.current.BAITIAN,'type':'light'}
  ];
  @override
  void initState() {
    super.initState();
  }
  @override
  Widget build(BuildContext context) {
    return YSBase(
      ysTitle: S.current.ZHUTISHEZHI,
      ysChild: Container(
        width: ysWidth(context),
        color: YSColors.containColor(context),
        child: ListView.separated(
          itemBuilder: (context,index){
            Map item = _list[index];
            bool isChoose = item['type']==YSUserRecord().them;
            return GestureDetector(
              onTap: (){

              },
              behavior: HitTestBehavior.opaque,
              child: Padding(
                padding: EdgeInsets.only(top: hsp(15),bottom: hsp(15)),
                child: Row(
                  children: [
                    Expanded(child: Text(item['title'],style: YSColors.contentStyle(context),)),
                    if(isChoose)Icon(Icons.check_circle,size: hsp(20),color: YSColors.iconColor(context),)
                  ],
                ),
              ),
            );
          },
          separatorBuilder: (context,index){
            return Divider(height: hsp(1),color: YSColors.lineColor(context),);
          },
          itemCount: _list.length,
          shrinkWrap: true,
          physics: const NeverScrollableScrollPhysics(),
          padding: EdgeInsets.only(left: hsp(15),right: hsp(15)),
        ),
      ),
    );
  }
}

