My flutter project is : here. When I try to run the code present in the Rahulraj
branch, I get the following error:
/C:/Users/Sanmitha/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_screenutil-5.6.1/lib/src/screen_util.dart:64:16: Error: The getter 'viewConfiguration' isn't defined for the class 'FlutterView'.
- 'FlutterView' is from 'dart:ui'.
Try correcting the name to the name of an existing getter, or defining a getter or field named 'viewConfiguration'.
if (window.viewConfiguration.geometry.isEmpty) {
^^^^^^^^^^^^^^^^^
Target kernel_snapshot failed: Exception
FAILURE: Build failed with an exception.
* Where:
Script 'C:flutterpackagesflutter_toolsgradleflutter.gradle' line: 1153
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:flutterbinflutter.bat'' finished with non-zero exit value 1
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 6s
Exception: Gradle task assembleDebug failed with exit code 1
Could anyone help me to debug this issue??? Please..?
2
Answers
Update: flutter_screenutil is updated, just use the actual version (5.7.0+).
= Original answer ==========================================
The issue is in the last flutter update:
https://github.com/flutter/flutter/issues/121742. Property FlutterView.viewConfiguration in is removed, but it’s used in flutter_screenutil library.
Possible solutions:
General recommendation is to use a Stable Flutter channel instead of Master.
This error is occurring in the Latest Version(3.9.0-1.0) of Flutter (March 2023) .
The Possible Solution to this is,
simply
flutter pub global activate fvm
OR..
2. Remove this package flutter_screenutil and use different options like MediaQuery.
OR..
3. Downgrade flutter
flutter downgrade v1.17.0