OpenFlutter / flutter_screenutil

Flutter screen adaptation, font adaptation, get screen information

Home Page:https://pub.dartlang.org/packages/flutter_screenutil

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The getter 'physicalGeometry' isn't defined for the type 'FlutterView'.

ankitmiyantechspian opened this issue · comments

After upgrading flutter package stopped working.

The getter 'physicalGeometry' isn't defined for the type 'FlutterView'.

Screenshot 2024-02-19 at 4 49 11 PM

I am facing the same issue

Replace the code with this in screen_util package.

static Future ensureScreenSize([
ui.FlutterView? window,
Duration duration = const Duration(milliseconds: 10),
]) async {
final binding = WidgetsFlutterBinding.ensureInitialized();
binding.deferFirstFrame();

await Future.doWhile(() {
  if (window == null) {
    window = binding.platformDispatcher.implicitView;
  }

  if (window == null || window!.physicalSize.isEmpty) {
    return Future.delayed(duration, () => true);
  }

  return false;
});

binding.allowFirstFrame();

}

### This version solved my issue flutter_screenutil: ^5.9.0

This issue is stale because it has been open for 30 days with no activity.