/*
 * @Author       : WuWei
 * @LastEditors  : WuWei
 * @Date         : 2023-03-13 17:15:13
 * @LastEditTime : 2023-05-10 09:09:40
 * @Description  : Do not edit
 */

part of '../index.dart';

class _UserInfoCardComponent extends StatelessWidget {
  const _UserInfoCardComponent({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    final style = WTheme.of(context);
    final colorScheme = style.colorScheme;
    final authGlobalStore = GetIt.I.get<AuthGlobalStore>();
    final data = authGlobalStore.info!;
    final PrivateMineStore store = Provider.of(context);
    final info = store.currentUserinfo;
    final name = info?.name ?? '';
    final phone = info?.phone ?? '';
    final imgUrl = data.imgUrl != null
        ? AppParseUtil.image(data.imgUrl!)
        : 'https://wy.huiguanjia.cn/9ad134a361f8d778/file/images/672405219659988992';
    return SliverToBoxAdapter(
      child: Wisdom.column(
        margin: EdgeInsets.symmetric(vertical: 15.pt, horizontal: 15.pt),
        padding: EdgeInsets.only(top: 30.pt),
        crossAxisAlignment: CrossAxisAlignment.stretch,
        children: <Widget>[
          Row(
            children: <Widget>[
              Wisdom(
                borderRadius: BorderRadius.circular(30.pt),
                child: WImage.network(
                  imgUrl,
                  width: 51.pt,
                  height: 51.pt,
                  fit: BoxFit.fill,
                  borderRadius: BorderRadius.circular(30.pt),
                ),
              ),
              SizedBox(width: 15.pt),
              Column(
                crossAxisAlignment: CrossAxisAlignment.stretch,
                children: <Widget>[
                  WisText(name, size: 19.pt, bold: true),
                  Row(children: [
                    Image.asset(
                      'lib/assets/main/icon_sj.png',
                      package: 'app_package',
                      width: 14.pt,
                    ),
                    WisText(phone, color: colorScheme.minor),
                  ]),
                ],
              ).asExpanded(),
            ],
          ),
        ],
      ),
    );
  }
}
