import 'package:flutter/material.dart';
import 'package:zhiying_base_widget/pages/team_page/model/team_style_model.dart';
import 'package:zhiying_base_widget/widgets/team/fans_list/model/team_fans_list_model.dart';
import 'package:zhiying_comm/zhiying_comm.dart';

class TeamFansNumberItemWidget extends StatelessWidget {
  TeamStyleModel styleModel;
  TeamFansListModel dataModel;

  TeamFansNumberItemWidget(this.styleModel, this.dataModel);

  @override
  Widget build(BuildContext context) {
    return Container(
      alignment: Alignment.center,
      margin: const EdgeInsets.only(left: 12.5, right: 12.5, top: 8),
      child: RichText(
        textAlign: TextAlign.center,
        text: TextSpan(text: '', children: [
          TextSpan(
            text: styleModel?.teamViewItemTitleList[0]?.text ?? '粉丝总人数',
            style: TextStyle(fontSize: 12, color: HexColor.fromHex(styleModel?.teamViewItemTitleList[0]?.textColor ?? '#333333'), fontWeight: FontWeight.bold),
          ),
          TextSpan(
            text: dataModel?.total ?? '0',
            style: TextStyle(
                fontSize: 18,
                color: HexColor.fromHex(styleModel?.teamViewItemTitleList[0]?.valueColor ?? '#FF4242'),
                fontFamily: 'Din',
                package: 'zhiying_comm',
                fontWeight: FontWeight.bold),
          ),
          TextSpan(
            text: styleModel?.teamViewItemTitleList[0]?.unitText ?? '人',
            style: TextStyle(fontSize: 12, color: HexColor.fromHex(styleModel?.teamViewItemTitleList[0]?.textColor ?? '#333333'), fontWeight: FontWeight.bold),
          ),
          TextSpan(
              text: styleModel?.teamViewItemTitleList[1]?.text ?? '当前分类人数',
              style: TextStyle(fontSize: 12, color: HexColor.fromHex(styleModel?.teamViewItemTitleList[1]?.textColor ?? '#333333'), fontWeight: FontWeight.bold)),
          TextSpan(
              text: dataModel?.categoryCount ?? '0',
              style: TextStyle(
                  fontSize: 18,
                  color: HexColor.fromHex(styleModel?.teamViewItemTitleList[1]?.valueColor ?? '#FF4242'),
                  fontFamily: 'Din',
                  package: 'zhiying_comm',
                  fontWeight: FontWeight.bold)),
          TextSpan(
              text: styleModel?.teamViewItemTitleList[1]?.unitText ?? '人',
              style: TextStyle(fontSize: 12, color: HexColor.fromHex(styleModel?.teamViewItemTitleList[1]?.textColor ?? '#333333'), fontWeight: FontWeight.bold)),
        ]),
      ),
    );
  }
}
