Issue I am developing a Flutter App and I got the error The argument type ‘bool?’ can’t be assigned to the parameter type ‘bool’. How I solve it? Here is the part of my Code where the error appears. I
Continue readingError: The argument type 'User?' can't be assigned to the parameter type 'User' because 'User?' is nullable and 'User' isn't. *(NullSafety)*
Issue I’m taking a course for Flutter and I think the course is a bit old, I’m trying to upgrade an old code to null safety, but since I’m just starting to learn null safety, I’m encountering errors and I
Continue readingFlutter Null Safety and Firebase authentication error
Issue I am using flutter and firebase for my app. I don’t know why I am getting error in below code. With degrade version of flutter(Without null safety) it is working fine but after migrating over null safety, I am
Continue reading"Cannot run with sound null safety" Flutter an existing Project?
Issue I had an existing application which i want to modify, I am using following dependencies: path_provider: ^2.0.8 http: ^0.13.4 html: ^0.15.0 custom_pop_up_menu: ^1.2.2 share: ^2.0.4 connectivity: ^3.0.6 flutter_swiper: ^1.1.6 Following error, i have even created a new empty project
Continue readingThe method '[]' was called on null. Receiver: null Tried calling: []("main") console error
Issue Hi i am working on a weather app i learnt from a course, everything was working fine till i start with the refactoring and it just got complicated the code show no error but when i hot restart the
Continue readingThe function call is not returning null but still giving "null" to be returned error
Issue I’m migrating my old version flutter code to latest version with null safety feature. In a function call I am getting the error "The body might complete normally, causing ‘null’ to be returned, but the return type is a
Continue readingI am trying to save the notification title and body using shared preference but i am unable to
Issue #I am trying to save the notification title and body locally and fetch the title and body inside my app to show all the sent notification in a listview but i am unable to #this is the code i
Continue readingA value of type 'Future<bool>' can't be returned from the function because it has a return type of 'Future<void>'
Issue I have: Future<bool> foo() async => true; This is allowed: Future<void> bar() { return foo(); // Works } but this is not: Future<void> baz() async { return foo(); // Error } In both bar and baz I’m returning a
Continue reading_TypeError (type 'Null' is not a subtype of type 'FutureOr<Stations>')
Issue Have recently installed Flutter null safety and having fixed most of the code I am having trouble with an API call. It returns _TypeError (type ‘Null’ is not a subtype of type ‘FutureOr<Stations>’) I haven’t found a SO answer
Continue readingI have a problem with Null Safety an the problem is 'Null check operator used on a null value'
Issue It happened when getting some data from firebase and decoding them using model, and here is the method: UserModel? userModel; void getUser() { emit(GetUserLoadingsState()); FirebaseFirestore.instance.collection(‘users’).doc(uId).get().then((value) { userModel = UserModel.fromJson(value.data()!); emit(GetUserSuccessState()); }).catchError((error) { emit(GetUserErrorState(error.toString())); }); } Calling the method return
Continue reading