fromNetwork static method

dynamic fromNetwork({
  1. required String url,
  2. required double size,
  3. required double radius,
  4. String errorText = "Error",
  5. Color errorBackgroundColor = Colors.grey,
  6. Color? errorTextColor = Colors.white,
})

Implementation

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