Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant run app #5

Open
hazmirmanija opened this issue Feb 9, 2021 · 1 comment
Open

Cant run app #5

hazmirmanija opened this issue Feb 9, 2021 · 1 comment

Comments

@hazmirmanija
Copy link

lib/main.dart:477:41: Error: The getter 'ScaffoldMessenger' isn't defined for the class '_MapViewState'.

  • '_MapViewState' is from 'package:flutter_maps/main.dart' ('lib/main.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'ScaffoldMessenger'.
    ScaffoldMessenger.of(context).showSnackBar(
    ^^^^^^^^^^^^^^^^^
    lib/main.dart:483:41: Error: The getter 'ScaffoldMessenger' isn't defined for the class '_MapViewState'.
  • '_MapViewState' is from 'package:flutter_maps/main.dart' ('lib/main.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'ScaffoldMessenger'.
    ScaffoldMessenger.of(context).showSnackBar(
    ^^^^^^^^^^^^^^^^^
    I clone hole from and check steps but not runing.

FAILURE: Build failed with an exception.

  • Where:
    Script 'C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 904

  • 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.
@arjunbhandari3
Copy link

Use Scaffold.of(context) instead of ScaffoldMessenger.of(context)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants