tuiBuild method

  1. @override
Widget tuiBuild(
  1. BuildContext context,
  2. TUIKitBuildValue value
)
override

Implementation

@override
Widget tuiBuild(BuildContext context, TUIKitBuildValue value) {
  final TUITheme theme = value.theme;

  return Stack(
    fit: StackFit.expand,
    clipBehavior: Clip.none,
    children: [
      if (isShowBigWhenClick)
        GestureDetector(
          onTap: () {
            Navigator.of(context).push(
              PageRouteBuilder(
                opaque: false, // set to false
                pageBuilder: (_, __, ___) => ImageScreen(
                    imageProvider: getImageProvider(), heroTag: faceUrl),
              ),
            );
          },
          child: Hero(
            tag: faceUrl,
            child: ClipRRect(
              borderRadius: borderRadius ??
                  selfInfoViewModel.globalConfig?.defaultAvatarBorderRadius ??
                  BorderRadius.circular(4.8),
              child: getImageWidget(context, theme),
            ),
          ),
        ),
      if (!isShowBigWhenClick)
        ClipRRect(
          borderRadius: borderRadius ??
              selfInfoViewModel.globalConfig?.defaultAvatarBorderRadius ??
              BorderRadius.circular(4.8),
          child: getImageWidget(context, theme),
        ),
      if (onlineStatus?.statusType != null && onlineStatus?.statusType != 0)
        Positioned(
          bottom: -4,
          right: -4,
          child: Container(
            width: 12,
            height: 12,
            alignment: Alignment.center,
            decoration: BoxDecoration(
              shape: BoxShape.circle,
              border: Border.all(
                color: Colors.white,
                width: 2.0,
              ),
              color: onlineStatus?.statusType == 1
                  ? theme.conversationItemOnlineStatusBgColor
                  : theme.conversationItemOfflineStatusBgColor,
            ),
            child: null,
          ),
        ),
    ],
  );
}