File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -178,7 +178,8 @@ class _MyHomePageState extends State<MyHomePage> {
178178 altWidget: (alt) => Text (alt),
179179 ),
180180 (attr, _) => attr["src" ] != null && attr["src" ].startsWith ("/wiki" ):
181- networkImageRender (baseUrl: "https://upload.wikimedia.org" ),
181+ networkImageRender (
182+ mapUrl: (url) => "https://upload.wikimedia.org" + url),
182183 },
183184 onLinkTap: (url) {
184185 print ("Opening $url ..." );
Original file line number Diff line number Diff line change @@ -90,14 +90,13 @@ ImageRender assetImageRender({
9090
9191ImageRender networkImageRender ({
9292 Map <String , String > headers,
93- String baseUrl ,
93+ String Function ( String ) mapUrl ,
9494 double width,
9595 double height,
9696 Widget Function (String ) altWidget,
9797}) =>
9898 (context, attributes, element) {
99- final src =
100- baseUrl != null ? baseUrl + _src (attributes) : _src (attributes);
99+ final src = mapUrl? .call (_src (attributes)) ?? _src (attributes);
101100 precacheImage (
102101 NetworkImage (
103102 src,
You can’t perform that action at this time.
0 commit comments