「The return type ‘bool’ isn’t a ‘Future‘」エラーの解決方法

Flutter

どうも、ちょげ(@chogetarou)です。

The return type ‘bool’ isn’t a ‘Future<bool>’, as required by the closure’s context.というエラーの解決方法を紹介します。

スポンサーリンク

解決方法

The return type ‘bool’ isn’t a ‘Future<bool>’, as required by the closure’s context.」は、クロージャーにasyncを追加することで解決できます。

() async {}

asyncを付けるだけで、awaitを使う必要はありません。

コメント

タイトルとURLをコピーしました