flutter_screenutil icon indicating copy to clipboard operation
flutter_screenutil copied to clipboard

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

Open ankitmiyantechspian opened this issue 1 year ago • 3 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

ankitmiyantechspian avatar Feb 19 '24 11:02 ankitmiyantechspian

I am facing the same issue

ankitparmar007 avatar Feb 19 '24 12:02 ankitparmar007

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();

}

ankitmiyantechspian avatar Feb 19 '24 12:02 ankitmiyantechspian

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

ski96277 avatar Feb 26 '24 04:02 ski96277

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

github-actions[bot] avatar Mar 28 '24 01:03 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Apr 11 '24 01:04 github-actions[bot]