/*
 * @Author       : WuWei
 * @LastEditors  : WuWei
 * @Date         : 2023-05-09 16:13:29
 * @LastEditTime : 2023-05-10 11:38:16
 * @Description  : Do not edit
 */
/*
 * @Author: XianKaiQun
 * @Date: 2020-09-09 17:09:58
 * @LastEditors: ChenYaJin
 * @LastEditTime: 2023-04-06 09:59:21
 * @Description: 
 */
part of '../index.dart';

class _PhotoComponent extends StatelessWidget {
  const _PhotoComponent({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    final style = WTheme.of(context);
    // final colorScheme = style.colorScheme;
    final store = Provider.of<PrivateAddStore>(context);

    return WisCard(
      isSliver: true,
      color: Colors.white,
      margin: EdgeInsets.symmetric(horizontal: 15.pt),
      elevation: 0,
      child: Wisdom(
        color: Colors.white,
        margin: EdgeInsets.symmetric(vertical: 15.pt),
        padding: EdgeInsets.all(15.pt),
        alignment: Alignment.center,
        child: Wisdom(
          onTap: () => store.facePicker(),
          alignment: Alignment.center,
          height: 90.pt,
          width: 90.pt,
          borderRadius: BorderRadius.circular(4.pt),
          border: Border.fromBorderSide(
            BorderSide(color: style.colorScheme.primary),
          ),
          child: store.imageId != null
              ? Stack(
                  children: [
                    WImage.network(
                      AppParseUtil.image(store.imageId!),
                      height: 90.pt,
                      width: 90.pt,
                      fit: BoxFit.cover,
                      borderRadius: BorderRadius.circular(4.pt),
                    ),
                    Positioned(
                      right: 0,
                      bottom: 0,
                      child: Container(
                        padding: EdgeInsets.all(3.pt),
                        color: Colors.black12,
                        child: Image(
                          image: AssetList.$camera_png_image,
                          width: 18.pt,
                        ),
                      ),
                    ),
                  ],
                )
              : WImage(
                  width: 60.pt,
                  image: AssetList.$addFace_png_image,
                ),
        ),
      ),
    );
  }
}
