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

not run #9

Open
kapilsharma-gts opened this issue Dec 4, 2022 · 4 comments
Open

not run #9

kapilsharma-gts opened this issue Dec 4, 2022 · 4 comments

Comments

@kapilsharma-gts
Copy link

C:/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_platform_widgets-1.20.0/lib/src/platform_button.dart:267:14: Error: The method 'FlatButton' isn't defined for the class 'PlatformButton'.

  • 'PlatformButton' is from 'package:flutter_platform_widgets/src/platform_button.dart' ('/C:/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_platform_widgets-1.20.0/lib/src/platform_button.dart').
    package:flutter_platform_widgets/src/platform_button.dart:1
    Try correcting the name to the name of an existing method, or defining a method named 'FlatButton'.
    return FlatButton(
    ^^^^^^^^^^
    /C:/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_platform_widgets-1.20.0/lib/src/platform_button.dart:300:12: Error: The method 'RaisedButton' isn't defined for the class 'PlatformButton'.
  • 'PlatformButton' is from 'package:flutter_platform_widgets/src/platform_button.dart' ('/C:/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_platform_widgets-1.20.0/lib/src/platform_button.dart').
    package:flutter_platform_widgets/src/platform_button.dart:1
    Try correcting the name to the name of an existing method, or defining a method named 'RaisedButton'.
    return RaisedButton(
    ^^^^^^^^^^^^
    /C:/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_platform_widgets-1.20.0/lib/src/platform_dialog_action.dart:171:14: Error: The method 'FlatButton' isn't defined for the class 'PlatformDialogAction'.
  • 'PlatformDialogAction' is from 'package:flutter_platform_widgets/src/platform_dialog_action.dart' ('/C:/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_platform_widgets-1.20.0/lib/src/platform_dialog_action.dart').
    package:flutter_platform_widgets/src/platform_dialog_action.dart:1
    Try correcting the name to the name of an existing method, or defining a method named 'FlatButton'.
    return FlatButton(
    ^^^^^^^^^^
    3

FAILURE: Build failed with an exception.
Script 'C:\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1159

  • What went wrong:
    Execution failed for task ':app:compileFlutterBuildDebug'.

Process 'command 'C:\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 6s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)

@akashmishra242
Copy link

This is due to an oudated package using deprecated widgets.

Reason of error :

The issue is due to "enough_gify_flutter" package whose last update was 9 month before and is using deprecated widgets.
thus, giving this type of error:

image

this is because some widgets such as FlatButton, RaisedButton etc is now deprecated and replaced by ElevatedButton and ElevatedButton...

image
https://docs.flutter.dev/release/breaking-changes/buttons#context

Solution :

Just remove the 'enough_gify_flutter' package and its relevent code everywhere in the project and it will work perfectly.

dear @RivaanRanawat kindly look into the matter and replace ''enough_gify_flutter'' package with other suitable package at pub.dev .

@kapilsharma-gts hope it helps and if yes, then close the issue.

Regards,
Akash @akashmishra242

@iambhabha
Copy link

i already fixed it the leg is not working

@akashmishra242
Copy link

akashmishra242 commented Dec 20, 2022

you might not be able to remove the relevent part where this package using deprecated widgets in involved.
It worked for me , check my repository where i have made the same app few days back taking reference from @RivaanRanawat youtube video:
https://github.com/akashmishra242/WhatsApp_clone

hope this will work for you.

@iambhabha
Copy link

Thanks

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

3 participants