0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

FutureBuilder で、中々snapshotが返ってこない

Posted at

環境

Flutter + Firebase + Providerを MVVMモデルで作っていた

問題

FutureBuilder 
   - StreamBuilder
       - FutureBuilder

のようなbuilder 処理がかなりのネストになっていたせいで、

  • Navigator.push 後の画面表示や、初回表示(kill後アプリ表示) で、15sくらい処理がローディング状態であった

解決策

AsyncMemoizerを使う

一番top level のFutureBuilder にて、AsyncMemoizer を使ったら、格段に処理が速くなった

AsyncMemoizer の使い方は、 ここらへんの記事 を参照

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?