Flutter:Dart copyWith method

Поділитися
Вставка
  • Опубліковано 10 кві 2023
  • Flutter and Dart copyWith method and how it works.
    copyWith() method creates immutable object. Which means you can not destroy or edit the object you create. One of the way to understand why it's immutable, you can understand from the constructor modifer const. If you put const modifier, it becomes immutable which means you won't be able to edit it.
    Another thing why copyWith() method returns immtuable object is that you see, all of our fields are final. If all the fields are final and constructor has const modifier, the return object must be immutable.
    Immutable objects are safe and easy to pass around. If you pass around immutable object, you don't need to worry that, they will be editted.
    Because nobody can edit them. So this is very safe for saving or recoding or storing data. That's how our chat state also becomes safe.
    Course that uses copy with method extensively
    www.dbestech.com/tutorials/on...
  • Наука та технологія

КОМЕНТАРІ • 13

  • @pravinprince3221
    @pravinprince3221 Рік тому

    Thank you for the wonderful video sir it is very helpful for me and my team, Thanks again sir
    I love your way of teaching sir thank you

  • @leleemagnu6831
    @leleemagnu6831 Рік тому

    Very good explanation. Thank you!

  • @kamil_supabase_enjoyer
    @kamil_supabase_enjoyer Рік тому +1

  • @adaada8008
    @adaada8008 Рік тому

    Hi, thank you for your video series :) As for continuation of Bloc topics could you enlighten any examples of usage blocWhen vs BlocSelector and if there was covered 'lazy' flag, then maybe 'listen' property aswell? :)

  • @FLUTTER_HUB
    @FLUTTER_HUB 8 місяців тому

    thanks

  • @belostone6623
    @belostone6623 Рік тому

    Macha allah brother thank you

  • @hellonishant
    @hellonishant 4 місяці тому

    thanks

    • @dbestech
      @dbestech  4 місяці тому

      You're welcome!