Ensure desktop gets high resolution photos

This commit is contained in:
Shawn 2022-10-27 10:25:03 -06:00
parent fbf7e055b7
commit cf07f46930

View File

@ -1,3 +1,4 @@
import 'package:flutter/foundation.dart';
import 'package:wonders/_tools/unsplash_download_service.dart';
import 'package:wonders/logic/common/platform_info.dart';
@ -26,7 +27,10 @@ class UnsplashPhotoData {
size = 1200;
break;
}
if (PlatformInfo.pixelRatio >= 1.5) {
bool isDesktop = defaultTargetPlatform == TargetPlatform.windows ||
defaultTargetPlatform == TargetPlatform.macOS ||
defaultTargetPlatform == TargetPlatform.linux;
if (PlatformInfo.pixelRatio >= 1.5 || isDesktop) {
size *= 2;
}
return 'https://wonderous.info/unsplash/$id-$size.jpg';