cssText method

String cssText()

Implementation

String cssText() {
  if (image != null) {
    switch (image.runtimeType) {
      case NetworkImage:
        return (image as NetworkImage).url;
      case FileImage:
        return (image as FileImage).file.uri.path;
      case MemoryImage:
        return 'data:image/png;base64, ${base64Encode((image as MemoryImage).bytes)}';
      case AssetImage:
        return 'assets://${(image as AssetImage).assetName}';
      default:
        return 'none';
    }
  }
  if (gradient != null) {
    switch (gradient!.runtimeType) {
      case CSSLinearGradient:
        return (gradient as CSSLinearGradient).cssText();
      case CSSRadialGradient:
        return (gradient as CSSRadialGradient).cssText();
      case CSSConicGradient:
        return (gradient as CSSConicGradient).cssText();
      default:
        return 'none';
    }
  }
  return 'none';
}