---
title: "Comment by Nicolas Chappuis on \"Flutter BLoC (v8): How to Fetch Data From an API? - 2022 Guide\" | Hashnode"
description: "Hey, Nice article ! I like it, BTW when I run the compiled app, I have an issue :( . The following _CastError was thrown building _BodyBuilder: type &#39;Null&#"
url: "https://hashnode.com/posts/flutter-bloc-v8-how-to-fetch-data-from-an-api-2022-guide/61d7d5078d56921d07b8ff95/comment/631f76c46c86d75accc7eb7d"
---

[Discussion](https://hashnode.com/posts/flutter-bloc-v8-how-to-fetch-data-from-an-api-2022-guide/61d7d5078d56921d07b8ff95)

Comment [Flutter BLoC (v8): How to Fetch Data From an API? - 2022 Guide](https://hashnode.com/posts/flutter-bloc-v8-how-to-fetch-data-from-an-api-2022-guide/61d7d5078d56921d07b8ff95)

[Nicolas Chappuis](https://hashnode.com/@NicoLoco)

[Sep 12, 2022](https://hashnode.com/posts/flutter-bloc-v8-how-to-fetch-data-from-an-api-2022-guide/61d7d5078d56921d07b8ff95/comment/631f76c46c86d75accc7eb7d)

Hey, Nice article ! I like it, BTW when I run the compiled app, I have an issue :(

. The following \_CastError was thrown building \_BodyBuilder: type 'Null' is not a subtype of type 'JokeBloc' in type cast

The relevant error-causing widget was Scaffold package:test\_bloc/…/home/home.dart:15 When the exception was thrown, this was the stack

Any idea what it can be ? Because I'm really interested to use this pattern for our future apps
