ResoCoder / flutter-ddd-firebase-course

https://resocoder.com/flutter-firebase-ddd-course
GNU General Public License v3.0
470 stars 161 forks source link

Lot of issues with Flutter 2 Null Satefy #25

Open SinaArdehali opened 3 years ago

SinaArdehali commented 3 years ago

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 :-)

totore86 commented 3 years ago

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:

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.

excellencemichel commented 3 years ago

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)

totore86 commented 3 years ago

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

adrianofreires commented 3 years ago

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?

Pawelek55 commented 3 years ago

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

alperefesahin commented 2 years ago

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