body method

Widget body(
  1. BuildContext context
)

UncompleteDocumentation

Implementation

Widget body(BuildContext context) {
  final decorationImageOrNull =
      ImageGeneralUiGeneralFramework.decorationImageOrNull(
    pathImage: pathImage,
    onError: onError,
    imageGeneralUiOptions: ImageGeneralUiGeneralFrameworkOptions(
      colorFilter: colorFilter,
      fit: BoxFit.cover,
    ),
  );
  final child = Container(
    height: height,
    width: width,
    margin: () {
      if (isWithBorder) {
        return null;
      }
      return margin;
    }(),
    decoration: BoxDecoration(
      color: color ?? context.theme.primaryColor,
      borderRadius: borderRadius ?? BorderRadius.circular(25),
      image: decorationImageOrNull,
      boxShadow: () {
        if (isWithBorder) {
          return null;
        }
        if (isUseShadow) {
          return context.extensionGeneralLibFlutterBoxShadows();
        }
        return null;
      }(),
    ),
    clipBehavior: Clip.antiAlias,
    child: MaterialButton(
      minWidth: 0,
      clipBehavior: Clip.antiAlias,
      onPressed: onPressed,
      onLongPress: onLongPress,
      onHighlightChanged: onHighlightChanged,
      highlightColor: Colors.transparent,
      child: () {
        if (decorationImageOrNull != null) {
          return null;
        }
        return Center(
          child: Text(
            nick_name.characters.firstOrNull ?? "-",
            style: context.theme.textTheme.titleSmall,
          ),
        );
      }(),
    ),
  );
  if (isWithBorder) {
    return Container(
      padding: const EdgeInsets.all(2),
      margin: margin,
      decoration: BoxDecoration(
        borderRadius: borderRadius ?? BorderRadius.circular(25),
        border: context.extensionGeneralLibFlutterBorderAll(),
        boxShadow: isUseShadow
            ? context.extensionGeneralLibFlutterBoxShadows()
            : null,
      ),
      child: child,
    );
  }
  return child;
}