flutter-ddd-firebase-course icon indicating copy to clipboard operation
flutter-ddd-firebase-course copied to clipboard

Lot of issues with Flutter 2 Null Satefy

Open SinaArdehali opened this issue 3 years ago • 6 comments

Hello, I am struggling a lot since 1 week, to make the whole code compatible with Flutter null safety and new versions of packages. Can you please make a little video or write a little thing explaining how we can do that ? Thanks a lot Resocoder :-)

SinaArdehali avatar Apr 08 '21 07:04 SinaArdehali

We have figured out with all package updated and with Flutter 2. We have only one issue with the timestamp in the NoteDto solved by eliminating the timestamp ;)

Some of modification:

  • updated context.bloc to context.read
  • updated all the null safety check
  • updated all required keyword removing the @
  • flushbar and flushbar helper is removed
  • ExtendedNavigator to AutoRouter
  • ...and so on.

P.S.: The timestamp is saved on firebase but when we create/update a note the timestamp from firebase is Null. This generate a NoteFailure.unexpectedError but if we refresh the app in the home all the notes have timestamp and they are created/updated.

totore86 avatar Apr 21 '21 15:04 totore86

Hi @totore86, can you tell me how do you resolde the error on the todolist item id ? When I attempt to go on note detail, the todoListItem id is null, and I got CastError (Null check operator used on a null value)

excellencemichel avatar Jun 11 '21 21:06 excellencemichel

Hi, I have just forked and created the pull request with flutter 2.2.2 and all dependencies at the latest version.

Check it out

totore86 avatar Jun 14 '21 10:06 totore86

We have figured out with all package updated and with Flutter 2. We have only one issue with the timestamp in the NoteDto solved by eliminating the timestamp ;)

Some of modification:

  • updated context.bloc to context.read
  • updated all the null safety check
  • updated all required keyword removing the @
  • flushbar and flushbar helper is removed
  • ExtendedNavigator to AutoRouter
  • ...and so on.

P.S.: The timestamp is saved on firebase but when we create/update a note the timestamp from firebase is Null. This generate a NoteFailure.unexpectedError but if we refresh the app in the home all the notes have timestamp and they are created/updated.

Hey man! Thank you! You will save me a lot of hour study. But why you take of the all fields serverTimeStamp?

adrianofreires avatar Jul 05 '21 23:07 adrianofreires

Here you will find the solution https://github.com/rrousselGit/freezed/issues/428#issuecomment-888798837

Pawelek55 avatar Oct 17 '21 17:10 Pawelek55

Hello all,

I recreate this repository, and asap I will publish it with the changes in the Medium article & YouTube. Stay tuned!

Medium: https://medium.com/@sahinefe YouTube: https://www.youtube.com/channel/UCcsgi-iDYAtQPmWI7I8e0pg

FlutterWiz avatar Oct 21 '22 18:10 FlutterWiz