TGStat
TGStat
Type to search
Advanced channel search
  • flag English
    Site language
    flag Russian flag English flag Uzbek
  • Sign In
  • Catalog
    Channels and groups catalog Search for channels
    Add a channel/group
  • Ratings
    Rating of channels Rating of groups Posts rating
    Ratings of brands and people
  • Analytics
  • Search by posts
  • Telegram monitoring
FlutterDev

6 Jul 2019, 18:09

Open in Telegram Share Report

New post on /r/flutterdev subreddit:

Avoid reallocating objects by using global constants.
Hi fellow flutter devs ...I have problem with flutter performance.Consider You have stateless widget with number of objects in build methods, objects are immutable and will not be changed. But in every build or constructing object. the same data will be created. for example:​class Foo extends StatelessWidget {final foo = SomeBigVarible();@override build(context){final bar = OtherBigVars();....}}​foo and bar are immutable. every time Foo instance is created, same foo and bar should be allocated. So I decide to use foo and bar as global (static) variables. They will never change and I don't have intention to use them as global state (So Please don't mention me to study StatefulWidget's or something else I already know them, my problem is something else) .So my problem is how much convenient using global variables like this in flutter apps? I don't see any example using them. Every one literally put big chunk of objects in build or constructor method's. Could this become problem in cases like threading?

July 06, 2019 at 04:34PM by Howard_banister
https://ift.tt/2RXsCup
r/FlutterDev - Avoid reallocating objects by using global constants.
0 votes and 1 comment so far on Reddit

42 0 0
Catalog
Channels and groups catalog Channels compilations Search for channels Add a channel/group
Ratings
Rating of Telegram channels Rating of Telegram groups Posts rating Ratings of brands and people
API
API statistics Search API of posts API Callback
Our channels
@TGStat @TGStat_Chat @telepulse @TGStatAPI
Read
Академия TGStat Telegram Research 2019 Telegram Research 2021 Telegram Research 2023
Contacts
Справочный центр Support Email Jobs
Miscellaneous
Terms and conditions Privacy policy Public offer
Our bots
@TGStat_Bot @SearcheeBot @TGAlertsBot @tg_analytics_bot @TGStatChatBot