File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 11import 'dart:async' ;
22import 'dart:collection' ;
33import 'dart:convert' ;
4+ import 'dart:io' ;
45import 'dart:typed_data' ;
56
67import 'package:html/dom.dart' as dom;
@@ -654,10 +655,15 @@ class WidgetsHTMLDecoder {
654655 }
655656 return Text ("" );
656657 }
657-
658- final netImage = await _saveImage (src);
659- return Image (MemoryImage (netImage),
660- alignment: customStyles.imageAlignment);
658+ if (src.startsWith ("http" ) || src.startsWith ("https" )) {
659+ final netImage = await _saveImage (src);
660+ return Image (MemoryImage (netImage),
661+ alignment: customStyles.imageAlignment);
662+ }
663+ final localImage = File (src);
664+ if (await localImage.exists ()) {
665+ return Image (MemoryImage (await localImage.readAsBytes ()));
666+ }
661667 }
662668 return Text ("" );
663669 } catch (e) {
You can’t perform that action at this time.
0 commit comments