fromNetwork static method

dynamic fromNetwork({
  1. required String url,
  2. required double size,
  3. Color? errorBackgroundColor,
  4. Color? errorTextColor,
  5. String? errorText,
})

Implementation

static fromNetwork({
  required String url,
  required double size,
  Color? errorBackgroundColor,
  Color? errorTextColor,
  String? errorText,
}) {
  return renderWidget(
    Image.network(
      url,
      fit: BoxFit.cover,
      width: size,
      height: size,
      loadingBuilder: (context, child, loadingProgress) =>
          loadingBuilder(context, child, loadingProgress, size),
      errorBuilder: (context, error, stackTrace) => errorBuilder(
        context,
        error,
        stackTrace,
        size,
        size / 2,
        errorBackgroundColor,
        errorTextColor,
        errorText,
      ),
      frameBuilder: frameBuilder,
    ),
    size,
  );
}