buildCircleAvatar method

  1. @protected
Widget buildCircleAvatar(
  1. BuildParameters params
)

Implementation

@protected
Widget buildCircleAvatar(BuildParameters params) {
  final props = params.spec.props;
  ImageErrorListener? onForegroundImageError;
  ImageErrorListener? onBackgroundImageError;
  var foregroundImage = params.buildProp("foregroundProvider",
      argument: props["foregroundValue"]);
  var backgroundImage = params.buildProp("backgroundProvider",
      argument: props["backgroundValue"]);

  if (foregroundImage != null) {
    onForegroundImageError = (ex, stack) {};
  }
  if (backgroundImage != null) {
    onBackgroundImageError = (ex, stack) {};
  }

  return CircleAvatar(
    key: properties.getKey(params.id),
    radius: tryParseDouble(props["radius"]),
    foregroundImage: foregroundImage,
    onForegroundImageError: onForegroundImageError,
    backgroundImage: backgroundImage,
    onBackgroundImageError: onBackgroundImageError,
    foregroundColor: tryParseColor(props["foregroundColor"]),
    backgroundColor: tryParseColor(props["backgroundColor"]),
    child: builder.tryBuildWidget(params.context, params.widgets["child"],
        params.state, params.parentContext),
  );
}