Earlier, I was using flutter 3.4, and My project compiled successfully. Recently, We've migrated to flutter 3.7 and I am getting the below error.
error: [+1994 ms] ../../../../../../development/flutter/packages/flutter/lib/src/material/color_scheme.dart:237:54: Error: The getter 'outlineVariant' isn't defined for the class 'Scheme'.
The issue happens due to the latest flutter version upgrade. I fixed the issue by downgrading the flutter version to flutter 3.4 instead of flutter 3.7
For me doing flutter clean and then flutter pub get solved the problem.
Related
After upgrading my flutter from 2.10.5 to 3.0.0, I have those errors on my android studio and the project don't build anymore on windows 10.
How can I solve this problems.
Thanks
'Size' is imported from both 'dart:ffi' and 'dart:ui'.
bitsdojo_window package seems to have issues when Flutter 3 was introduced. One of possible ways is to run this command on your terminal
dart fix --apply
and
flutter pub upgrade
This happens because of Flutter 3.0. This package needs to get updated for Flutter 3.0
check This Link for the answer it requires an update which the developer said he's working on it
how can I fix this error in flutter with android studio
/C:/src/flutterSDK/flutter/.pub-cache/hosted/pub.dartlang.org/get-4.6.3/lib/get_navigation/src/snackbar/snackbar.dart:452:31: Error: Method 'addPostFrameCallback' cannot be called on 'SchedulerBinding?' because it is potentially null.
'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('/C:/src/flutterSDK/flutter/packages/flutter/lib/src/scheduler/binding.dart').
Try calling using ?. instead.
SchedulerBinding.instance.addPostFrameCallback(
^^^^^^^^^^^^^^^^^^^^
This error happens because the package get 4.6.2 or 4.6.3 is for new flutter sdk version 3.0. So you got this error. you have to use get 4.6.1 for fluter SDK version 2.xx
I had the same problem.. on "dart.get" package. Then I did this..
First go to pubspec.yaml file then edit the get version not more than
(get: ^4.6.1).. if you are using fluter sdk v2.xx.
if the version won't get lower then try this method
go to pubspec.lock file. edit the version not more than (4.6.1).. if you are using fluter sdk v2.xx.
you will find in pubspec.lock file
and last you have to do this
then "pub get" .. error will be gone.
This is because of recent flutter updates. All flutter SDKs >= V2.10.3 have this issue. There's no proper solution for this error yet.
Temporary Solution:
You can simply downgrade your flutter SDK to V2.10.2 or lower to get rid of this issue.
Note:
After downgrading, make sure you also change the dart version in pubspec.yaml of your flutter project according to the Flutter SDK.
This error is due to some changes happened in null-safety properties in Flutter 3.0.0. In your case you can try to import:
get: 4.6.1 instead of get: ^4.6.3.
Source: https://github.com/jonataslaw/getx/issues/2356
try this
flutter doctor --android-licenses
when i put admob_flutter: ^2.0.0-nullsafety.1 in pubspec, and type on cmd flutter pub get this error occurs!
The plugin admob_flutter uses a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to see if this plugin supports the Android V2 embedding. Otherwise, consider removing it since a future release of
Flutter will remove these deprecated APIs.
It's for latest flutter updates. so you can't do anything. Please use other package or wait till fix the problem by package developer because this error is produced after flutter version 2.5.
I have downgraded my flutter version by command flutter downgrade and it shows an option of a downgraded flutter version and it resolves my error.
Downgrading flutter worked for me.
I update the Flutter latest stable version 1.20.1 when I click the run button on an already existing project it shows me this error:
Could not resolve the package 'characters' in 'package: characters/characters.dart'.
But when I create a new project and try to run it works.
Following the Github issue below, it is a common issue after upgrading to a different Flutter Version
Could not resolve package characters
In my case, I resolved the issue with flutter clean.
I updated my flutter and dart package last night and now StaggeredGridView which was scrolling perfectly before is giving me an error:
[ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: type 'SliverHitTestResult' is not a subtype of type 'BoxHitTestResult'
i had the same problem , and i solved upgrading the version in pubspeck.yaml to flutter_staggered_grid_view 0.3.0
The BoxHitTestResult exception was fixed in new version of flutter_staggered_grid_view 0.3.0
You can check changelog here
If you have same issue after the upgrade,
run flutter clean in terminal and then run again.
#Yamim comment: "switch your channel to stable" worked.
Here is the command you can use:
flutter channel stable
Other Channels:
$ flutter channel
Flutter channels:
* stable
beta
dev
master
For more information about channels you can refer:
https://github.com/flutter/flutter/wiki/Flutter-build-release-channels
This issue is resolved in the upgraded package No need to modify the code just upgrade the package.
Add the following dependencies to your pubspec.yaml and restart the application. It works well.
flutter_staggered_grid_view: 0.3.0