Revert image support added on web

pull/33/head
singerdmx 4 years ago
parent 3547e015e4
commit f8cd4b57b9
  1. 16
      lib/widgets/editor.dart

@ -1,7 +1,5 @@
import 'dart:html' as html;
import 'dart:io'; import 'dart:io';
import 'dart:math' as math; import 'dart:math' as math;
import 'dart:ui' as ui;
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
@ -80,19 +78,7 @@ Widget _defaultEmbedBuilder(BuildContext context, leaf.Embed node) {
switch (node.value.type) { switch (node.value.type) {
case 'image': case 'image':
if (kIsWeb) { if (kIsWeb) {
String imageUrl = node.value.data; return SizedBox.shrink();
ui.platformViewRegistry.registerViewFactory(
imageUrl,
(int viewId) => html.ImageElement()..src = imageUrl,
);
return Container(
constraints: BoxConstraints(maxWidth: 300),
height: MediaQuery.of(context).size.height,
child: HtmlElementView(
viewType: imageUrl,
),
);
} }
String imageUrl = node.value.data; String imageUrl = node.value.data;
return imageUrl.startsWith('http') return imageUrl.startsWith('http')

Loading…
Cancel
Save