Skip to content

Commit

Permalink
Merge pull request #88 from WhiteXero/main
Browse files Browse the repository at this point in the history
deprecate BuildContext in Utils.getScreenInfo()
  • Loading branch information
Predidit authored Jul 23, 2024
2 parents bbf032d + f9719b5 commit 68d9a8e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/utils/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ import 'package:screen_pixel/screen_pixel.dart';
class Utils {
static final Random random = Random();

static Future<Map<String, double>?> getScreenInfo(BuildContext context) async {
static Future<Map<String, double>?> getScreenInfo() async {
final screenPixelPlugin = ScreenPixel();
Map<String, double>? screenResolution;
final screenRatio = MediaQuery.of(context).devicePixelRatio;
final MediaQueryData mediaQuery = MediaQueryData.fromView(WidgetsBinding.instance.platformDispatcher.views.first);
final double screenRatio = mediaQuery.devicePixelRatio;
Map<String, double>? screenInfo = {};

try {
Expand Down

0 comments on commit 68d9a8e

Please sign in to comment.