StaggeredGridView not scrolling after updating Flutter - flutter

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

Related

The getter 'outlineVariant' isn't defined for the class 'Scheme'

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.

Calling Firebase.initializeApp() returns 'Unable to establish connection on channel' - Flutter + Firebase

I'm working with Firebase in flutter (latest versions as of 1st July 2022), and when I try to call Firebase.initializeApp() in my Main function, it returns an error of:
'[ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel., null, null)'
Here is my code:
void main() async {
WidgetsFlutterBinding.ensureInitialized();
Firebase.initializeApp();
runApp(const MyApp());
}
Any help would be greatly appreciated
I was able to solve the problem by upgrading all my firebase dependencies to the latest version using flutter pub outdated and flutter pub upgrade firebase_....
I encountered this issue after adding the firebase_messaging plugin v11.4.4. Might be related to the change in firebase_core_platform_interface.
Also got it after a pub update. Fixed it by doing:
flutter clean
and removing the pubspec.lock
Do a flutter clean and upgrade firebase core with
flutter pub upgrade firebase_core
The run
dart pub global activate flutterfire_cli
flutterfire configure
to reinitialize firebase. I experienced this after adding app_check support
I have updated the below dependency:
dependency_overrides:
firebase_core_platform_interface: 4.4.1
Executed this command and updated firebase dependencies
flutter pub upgrade firebase_core
flutter pub upgrade firebase_messaging
it is working properly now.
Problem seems to be with the core platform interface.
Add firebase_core_platform_interface: 4.4.0 and adjust all other firebase deps to make them compatible with this library. I downgraded all versions to 36 day old release and it finally works.
I just built a new flutter app and I got this error when initializing Firebase App and running it in the browser and not the android emulator. I am using VS Code and you can change the target device in the bottom task bar on the right side.
Solution is to run it in the android emulator. I don't know if there are permissions to be set for web view but I do not plan on deploying to web.
Had the same problem and scaled back (thank you git) - getting flutter dependencies right - as in it compiles and work as advertised is no mean feat. Welcome :)

Flutter Basics: Error: Type 'AssetBundle' not found. AssetBundle' isn't a type

After I added the flutter_svg: ^0.23.0+1 in pubsec.yaml getting these error.
Please check your Flutter version.
At flutter_svg github issue page, there is a same issue and solution comment.
https://github.com/dnfield/flutter_svg/issues/610
If you are on stable channel, make sure Flutter version is at least 2.5.0. You need at least 2.4.0 pre for the latest version of this package
If you do not want to upgrade your flutter, then this is also a viable solution,
use flutter_svg: ^0.22.0
https://github.com/dnfield/flutter_svg/issues/610#issuecomment-974614148
I'm on 2.2 and it is working very well.

Flutter stable version 1.20.1 build failed issue

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.

Flutter app Error while initializing the Dart VM: Wrong full snapshot version, expected '8343.....' found '46b2....'

flutter app was working getting build and run on Xcode 10 on device iOS 12 fine before,
The time dart upgrade 2.1.0 happen in Flutter build iOS worked well with command and on Xcode 10 after build get success while running Flutter app on iPhone 7 iOS 12, it started giving error and app gets crash with following error message in Xcode logs.
Error is Runner[410:28754] [VERBOSE-3:dart_vm.cc(403)] Error while initializing the Dart VM: Wrong full snapshot version, expected '8343f188ada07642f47c56e518f1307c' found '46b2bfb57b5647c5f7527ff9aa56c69b'
Here are the details of the flutter sdk and dart .
Flutter 0.11.9 • channel beta • https://github.com/flutter/flutter.git
Framework • revision d48e6e4
Engine • revision 5c8147450d
Tools • Dart 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)
I have experienced this error and none of the above solution worked for me infact the option of clearing the flutter/bin/cache messed the entire vscode IDE.
So I deleted the entire flutter SDK and installed fresh new SDK from flutter official website.
After this installation everything was working fine.
I had this issue after a flutter upgrade. Uninstalling the app from the device and then flutter running it again solved the problem.
After deleting the flutter/bin/cache and running flutter clean, I couldn't get the dart sdk to load until I launched the flutter console (flutter_console.bat) that can be found in the directory where you installed flutter and ran flutter doctor there. That solved the problem.
Do git clean -xffd in flutter installed directory(repo).
If it's a Flutter project first try flutter clean if did not work, try above git command.
If still not solved, delete everything inside /flutter/bin/cache and try.
If still not :D,
Do flutter channel master, flutter upgrade, and flutter clean. If nothing worked please add a comment below.
If you are in Dart environment out flutter/bin/cach/dart-sdk, you may be not upgraded dart-sdk. This happen to me Dart 2.5.0 with chololate installed. So I just did choco upgrade dart-sdk
I have exactly this problem i Solve it how ?
by these comments you just update flutter
flutter channel beta
,
flutter upgrade
you should upgrade your dart sdk
So try this command :
choco install dart-sdk
if this is not work for you download it from this link
https://dart.dev/tools/sdk/archive;
and replace it with your current dart-sdk in flutter
I also have experienced the same issue. I upgraded the flutter version and later downgraded and encounter this issue maily on IOS adhoc build.
Solution:
Delete out $FLUTTER_HOME/bin/cache and run flutter doctor.
This will solve.
What worked for me was changing channel and upgrading and then changing channel back and upgrading.
I had to remove the flutter SDK folder in my computer completely and redownload the latest one at https://flutter.dev/docs/get-started/install/macos
Then, I ran flutter doctor.
You can find where your flutter folder is by typing which flutter in your terminal.
You don't need to uninstall the whole flutter and set environment path or anything else.
Just downgrade to any version by doing the below commands, suppose my current flutter version is v3.3.8 and I come across this issue then:
Go to flutter sdk-path in the command prompt and checkout to any branch you would like to switch for a moment, like v2.5.0. So,
By doing this you changed your repository from v3.3.8 to v2.5.0
git checkout v2.5.0
You can check previous flutter versions from here
link
Downgrade your flutter version to 2.5.0
flutter downgrade v2.5.0
Then upgrade flutter
flutter upgrade