Search code examples
flutterflutter-dependenciesflutter-web

Flutter Get package error no named parameter with the name 'useInheritedMediaQuery'


I got error after I added get package and implemented it to my controller. If I add final myController = Get.put(MyController()); I got this error, yes just one line code. I use 4.6.1 version.

This is the error

../../.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,
                ^^^^^^^^^^^^^^^^^^^^^^
../../snap/flutter/common/flutter/packages/flutter/lib/src/material/app.dart:168:9: Context: Found this candidate, but the arguments don't match.
  const MaterialApp({
        ^^^^^^^^^^^

I've downgraded Get version to 4.3.8 but doesn't work.

This is my flutter doctor

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 2.4.0-5.0.pre.43, on Ubuntu 20.04.3 LTS 5.13.0-28-generic, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
[✓] Chrome - develop for the web
[✓] Linux toolchain - develop for Linux desktop
[✓] Android Studio (version 2020.3)
[✓] VS Code (version 1.63.2)
[✓] Connected device (2 available)

• No issues found!


Solution

  • I solved the issue after I follow this. I've updated get to 4.3.8 version manually in pubspec.yaml and pubspec.lock and it works.