Search code examples
flutterdartgetpackagepubspec

GetX Flutter v4.6.1 some issues


In my project I used GetX v4.6.1. When it Build on debug mode, I faced this bugs

/C:/Users/ALIF/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/get-4.6.1/lib/get_navigation/src/root/get_material_app.dart:275:17: Error: No named parameter with the name 'useInheritedMediaQuery'.
                useInheritedMediaQuery: useInheritedMediaQuery,         
                ^^^^^^^^^^^^^^^^^^^^^^                                  
/C:/src/flutter/packages/flutter/lib/src/material/app.dart:217:9: Context: Found this candidate, but the arguments don't match.
  const MaterialApp.router({                                            
/C:/Users/ALIF/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/get-4.6.1/lib/get_navigation/src/root/get_material_app.dart:322:17: Error: No named parameter with the name 'useInheritedMediaQuery'.                                                                                                  useInheritedMediaQuery: useInheritedMediaQuery,
                ^^^^^^^^^^^^^^^^^^^^^^
/C:/src/flutter/packages/flutter/lib/src/material/app.dart:166:9: Context: Found this candidate, but the arguments don't match.
  const MaterialApp({
        ^^^^^^^^^^^
/C:/Users/ALIF/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/get-4.6.1/lib/get_navigation/src/root/get_cupertino_app.dart:252:17: Error: No named parameter with the name 'useInheritedMediaQuery'.                                                                                                 useInheritedMediaQuery: useInheritedMediaQuery,
                ^^^^^^^^^^^^^^^^^^^^^^
/C:/src/flutter/packages/flutter/lib/src/cupertino/app.dart:189:9: Context: Found this candidate, but the arguments don't match.
  const CupertinoApp.router({                                           
        ^^^^^^^^^^^^^^^^^^^                                             
/C:/Users/ALIF/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/get-4.6.1/lib/get_navigation/src/root/get_cupertino_app.dart:292:17: Error: No named parameter with the name 'useInheritedMediaQuery'.
                useInheritedMediaQuery: useInheritedMediaQuery,         
                ^^^^^^^^^^^^^^^^^^^^^^                                  
/C:/src/flutter/packages/flutter/lib/src/cupertino/app.dart:145:9: Context: Found this candidate, but the arguments don't match.
  const CupertinoApp({                                                  
        ^^^^^^^^^^^^                                                    
                                                                        
                                                                        
FAILURE: Build failed with an exception.                                
                                                                        
* Where:                                                                
Script 'C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1035

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\src\flutter\bin\flutter.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 1m 23s                                                  
Running Gradle task 'assembleDebug'...                                  
Running Gradle task 'assembleDebug'... Done                        87.9s
Exception: Gradle task assembleDebug failed with exit code 1

I'm also already followed this references but still not resolve the issues. First time I faced this issues is when at MyApp widget (root) on my project would change from MaterialApp to be GetMaterialApp, only.


Solution

  • In pubspec.yaml use get package like below :

    get: 4.6.1

    # Don't use ^