The named parameter "backgroundColor" is not defined error in ElevatedButton.styleFrom - flutter-layout

The named parameter "backgroundColor" is not defined error in ElevatedButton.styleFrom
Getting error in flutter code. Elevated button error. How to make supported elevated button backgroundColor or disabledForegroundColor.

You can switch to stable version 3.3.x, your version is Flutter 3.5.0-10.0.pre.
You can try flutter channel stable , then flutter upgrade

Related

Why I can't change Dart-SDK path and version in Android Studio?

My Android Studio somehow still used Dart-SDK ver. 2.14.4 even though I have downloaded the 2.16.2
I tried changing the path to my latest Dart-SDK in Languanges & Frameworks in Settings.
Then I click apply and run "flutter pub get" but still get this error message
The current Dart SDK version is 2.14.4.
I close the Android Studio app, then I open it again.
I run "flutter pub get" and the same error message shows.
I check the Dart-SDK path in Settings and somehow I don't know how the path goes back to 2.14.4 even though I already changed it earlier?
W-w what happens?
How can I fix this?
The Flutter SDK contains a Dart SDK that it is designed to work with. Manually setting the Dart SDK is not supported when the Flutter plugin is installed.
just upgrade your flutter SDK.

Gradle sync failed: com.android.tools.idea.gradle.project.sync.idea.issues.SdkPlatformNotFoundException: Module: 'app' platform 'android-29' not found

Installed Android 4.1 on Ubuntu 20.04. Getting the following error:
Gradle sync failed: com.android.tools.idea.gradle.project.sync.idea.issues.SdkPlatformNotFoundException: Module: 'app' platform 'android-29' not found.
On opening the SDK manager I get the following screen:
I also executed
$ANDROID_HOME/cmdline-tools/tools/bin/sdkmanager --licenses
How to fix this?
------ edit ---------
This is what shows in the SDK Platforms tab. Unchecking the "Hide Obsolete Packages" doesn't change anything.
As the error is saying. Install the SDK Platform with API Level 29. YOu need to switch to the tab " SDK Platforms and install the right API Level:
-----------edit--------------
maybe you changed accidently your SDK location.
Mine is on C:\Users\elmo\AppData\Local\Android\Sdk
Pay attention: using it on windows.
go to the "sdk platforms" you can find it by click on navigate->find anywhere than enter "sdk"
than what you need is to find the api level you need (29 in your case) and check the box near it.
Go to File -> Project Structure -> Modules(Properties Tab) -> Change the compile Sdk Version and Build Tools Version to the the latest version available at the time
img

Flutter issues after flutter upgrade to Flutter 1.11.0 (Mac OS)

After upgrading flutter to 1.11.0 it is showing this error below when trying to run a project.
Couldn't read file LocalFile:
'/Users/h/flutter/.pub-cache/hosted/pub.dartlang.org/audio_recorder-1.0.1/android/src/main/kotlin/com/jordanalcaraz/audiorecorder/audiorecorder/AudioRecorderPlugin.kt'
even though it exists. Please verify that this file has read
permission and try again.
A colleague found this:
https://github.com/ZaraclaJ/audio_recorder/issues/46
And according to DyaryRaoof the solution is:
I am on the master branch. This error appears in iOS.
To solve it you need to locate your audio_recorder plugin inside flutter. then change the name of it's last child folder on android. You have to change it from audio_recorder to audiorecorder(remove the underscore).
Or just wait for the package maintainer to solve that issue.

Unable to run flutter project

I've installed flutter SDK and started a new sample project , but couldn't run it ,here is the logCat
I tried running it on both android studio and VsCode and got the exact same log message.
When I tied running flutter doctor command in terminal I got this error:-
I think the issue is in the Dart-SDK but I've downloaded it from the flutter page as well as from Dart documentation.
Here are my environment variables in path
C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Git\git-cmd.exe;C:\Windows\System32;C:\flutter\flutter\bin
Try putting flutter in C:\src (full path should be : C:\src\flutter\ )
You should also update your env variables in path to : C:\src\flutter\bin, do that also for Dart sdk, env variable should be : C:\src\flutter\bin\cache\dart-sdk\bin
After That go to command line and type flutter doctor.

Flutter create command was unsuccessful

I'm creating a new flutter project in Android studio for the first time. I give the project a name and choose Flutter sdk. I then clicked finish and then noting happened. Android studio says that
"Flutter create command was unsuccessful"
When I navigate to command directory using file explorer, I new folder is created with the project name I've given but it is empty.
Please help.
I don't think you installed flutter correctly. First and foremost, make sure you run flutter doctor from your terminal.
If it doesn't work then you didn't install flutter properly.
If it works, try creating your project via terminal by typing flutter create projectname
I hade the same issue in ubuntu
first, check flutter doctor and solve the error if there was
then check the git installation
in my case, I didn't install git
On Windows at least you need to add <flutter_dir>\bin to your path, and then restart Android Studio. It is not clear to me why Android Studio needs to know the location of the Flutter SDK if it doesn't then use that information but... :shrug:
Git also needs to be in the PATH too (as C:\Program Files\Git\cmd); I have always used git-bash just fine without that but now it seems to be a requirement that isn't clearly surfaced when upgrading.
In My case set the flutter sdk path first while create the app and then create the app

Resources