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> {
178
178
altWidget: (alt) => Text (alt),
179
179
),
180
180
(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),
182
183
},
183
184
onLinkTap: (url) {
184
185
print ("Opening $url ..." );
Original file line number Diff line number Diff line change @@ -90,14 +90,13 @@ ImageRender assetImageRender({
90
90
91
91
ImageRender networkImageRender ({
92
92
Map <String , String > headers,
93
- String baseUrl ,
93
+ String Function ( String ) mapUrl ,
94
94
double width,
95
95
double height,
96
96
Widget Function (String ) altWidget,
97
97
}) =>
98
98
(context, attributes, element) {
99
- final src =
100
- baseUrl != null ? baseUrl + _src (attributes) : _src (attributes);
99
+ final src = mapUrl? .call (_src (attributes)) ?? _src (attributes);
101
100
precacheImage (
102
101
NetworkImage (
103
102
src,
You can’t perform that action at this time.
0 commit comments