Flutter `UniqueKey()` कब उपयोगी है? में performance के लिए क्या ध्यान रखें?
Flutter `UniqueKey()` कब उपयोगी है? में performance के लिए क्या ध्यान रखें?
सही उत्तर: Widget को हर build में नया identity देना intentionally चाहिए तब; excessive use state loss कर सकता है.
व्याख्या: Widget को हर build में नया identity देना intentionally चाहिए तब; excessive use state loss कर सकता है. यह इस प्रश्न के संदर्भ में सही उत्तर है। Flutter/Dart development में concept को समझने के साथ उसके lifecycle, constraints, error handling और practical usage को भी ध्यान में रखना चाहिए. पहले profiling/measurement करें, फिर targeted optimization करें.
Developer note: Flutter `UniqueKey()` कब उपयोगी है?