skip to Main Content

Flutter – I can't get Future to complete with a value

A value of type Object? can't be returned from the method getUser because it has a return type of Future<UserModel>. Future<UserModel> getUser(String userId) async { QuerySnapshot userDoc = await _usersCollectionRef.where('userId', isEqualTo: userId).get(); print('user doc: ${userDoc.docs[0].data()}'); //user doc: Instance of 'UserModel'…

VIEW QUESTION

Flutter – Dart get package name

I have Dart only project. How to print the package name ? For example: package:myapp/something.dart How to print this "myapp" from the Dart program itself ? In other word, I am reffering to the first line of pubspec.yaml name: myapp…

VIEW QUESTION

Error with 'markNeedsBuild' in syncfusion_flutter_charts After Flutter Upgrade

I'm using the Syncfusion Chart in my Flutter application, and everything was working fine until I upgraded Flutter to the latest version. Now, I'm encountering the following error during debugging: Error (Xcode): ../../.pub-cache/hosted/pub.dev/syncfusion_flutter_charts-25.2.6/lib/src/charts/cartesian_chart.dart:1367:22: Error: The method 'markNeedsBuild' isn't defined for…

VIEW QUESTION
Back To Top
Search