flutter-whatsapp-clone icon indicating copy to clipboard operation
flutter-whatsapp-clone copied to clipboard

not run

Open kapilsharma-gts opened this issue 2 years ago • 4 comments

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)

kapilsharma-gts avatar Dec 04 '22 11:12 kapilsharma-gts

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

akashmishra242 avatar Dec 20 '22 13:12 akashmishra242

i already fixed it the leg is not working

iambhabha avatar Dec 20 '22 13:12 iambhabha

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.

akashmishra242 avatar Dec 20 '22 13:12 akashmishra242

Thanks

iambhabha avatar Dec 20 '22 13:12 iambhabha