Remove proxy code
This commit is contained in:
parent
c4e34edfd2
commit
79631cd91d
@ -28,14 +28,6 @@ class AppImage extends StatefulWidget {
|
|||||||
final Color? color;
|
final Color? color;
|
||||||
final double? scale;
|
final double? scale;
|
||||||
|
|
||||||
static String maybeAddImgProxy(String url) {
|
|
||||||
String proxyUrl = 'proxy.wonderous.app:8081/';
|
|
||||||
if (!url.contains(proxyUrl) && (url.contains('images.metmuseum.org') || url.contains('img.youtube.com'))) {
|
|
||||||
url = 'https://$proxyUrl$url';
|
|
||||||
}
|
|
||||||
return url;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<AppImage> createState() => _AppImageState();
|
State<AppImage> createState() => _AppImageState();
|
||||||
}
|
}
|
||||||
@ -59,15 +51,9 @@ class _AppImageState extends State<AppImage> {
|
|||||||
void _updateImage() {
|
void _updateImage() {
|
||||||
if (widget.image == _sourceImage) return;
|
if (widget.image == _sourceImage) return;
|
||||||
_sourceImage = widget.image;
|
_sourceImage = widget.image;
|
||||||
/// Apply proxy to MET api images
|
|
||||||
if(kIsWeb && _sourceImage is NetworkImage){
|
|
||||||
final url = (_sourceImage as NetworkImage).url;
|
|
||||||
_sourceImage = NetworkImage(AppImage.maybeAddImgProxy(url));
|
|
||||||
}
|
|
||||||
_displayImage = _capImageSize(_addRetry(_sourceImage));
|
_displayImage = _capImageSize(_addRetry(_sourceImage));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return ImageFade(
|
return ImageFade(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user