From cf07f469305421b45be00ee764851a35540c1041 Mon Sep 17 00:00:00 2001 From: Shawn Date: Thu, 27 Oct 2022 10:25:03 -0600 Subject: [PATCH] Ensure desktop gets high resolution photos --- lib/logic/data/unsplash_photo_data.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/logic/data/unsplash_photo_data.dart b/lib/logic/data/unsplash_photo_data.dart index 8943c172..5f7bde58 100644 --- a/lib/logic/data/unsplash_photo_data.dart +++ b/lib/logic/data/unsplash_photo_data.dart @@ -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';