Why you should NOT use BuildContext in an async gap? | Flutter Lints

Поделиться
HTML-код
  • Опубликовано: 7 ноя 2024

Комментарии • 6

  • @someshsahu4638
    @someshsahu4638 Год назад +1

    very nice explanation thank you so much 🙏🏼🙏🏼🙏🏼

    • @sm-sayedi
      @sm-sayedi  Год назад +1

      Happy it was helpful! 🙂

  • @chind0na
    @chind0na Год назад

    I am getting AsyncGap warnings. Thank you for this.

  • @meetrajpopat2348
    @meetrajpopat2348 Год назад

    Whats difference between context.mounted and only mounted?

    • @sm-sayedi
      @sm-sayedi  Год назад +1

      @meetrajpopat2348 In the case of `context.mounted`, mounted is a property of the BuildContext class, which can be accessed in both StatelessWidget and StatefulWidget. In the case of only `mounted`, it is a property of the State class, which can only be accessed in a StatefulWidget.
      Technically both of them represent the same thing, which is if the current widget is in the widget tree!