Support image on local device storage without uploading

pull/13/head
Xin Yao 4 years ago
parent 95c4df5432
commit b04f31e118
  1. 5
      lib/widgets/editor.dart

@ -83,7 +83,10 @@ Widget _defaultEmbedBuilder(BuildContext context, Embed node) {
color: Colors.grey.shade200,
);
case 'image':
return Image.network(node.value.data);
String imageUrl = node.value.data;
return imageUrl.startsWith('http')
? Image.network(imageUrl)
: Image.asset(imageUrl);
default:
throw UnimplementedError(
'Embeddable type "${node.value.type}" is not supported by default embed '

Loading…
Cancel
Save