Skip to content

Session11 #12

Description

@github-actions

スレッドブロック

時間のかかる処理を扱ってみましょう。

課題

  • 使用する API を fetchWeather() から syncFetchWeather() に変更する
  • API の処理が戻るまで CircularProgressIndicator を表示する

動作イメージ

demo

ヒント

Dart の実行モデルはシングルスレッド・イベントループです。

そのため、そのままだと画面が固まってしまい CircularProgressIndicator は表示されません。

よって、このようにスレッドをブロックしてしまうような処理の場合は isolates を使用します。

参考資料

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions