<p>I would check out this package, <a href="https://pub.dev/packages/blockfrost" rel="nofollow noreferrer">https://pub.dev/packages/blockfrost</a>.  I know this package is being used in at least one place for the Manzano app which can be found here, <a href="https://manzano.studio/#/" rel="nofollow noreferrer">https://manzano.studio/#/</a></p>

CC BY-SA 4.0
2022-02-16T22:05:32.967Z
This is the correct answer. Use the library. I just struggled with the setup. If others struggle with Flutter/Cardano aswell I'm answering what I've been doing to get things going.
Dani_Rango
CC BY-SA 4.0
2022-02-13T15:15:41.150Z
2022-02-13T15:15:41.150Z
Matt Ho
<p>I got it working for me, these steps may work for you.</p>
<ol>
<li>Work through <a href="https://docs.flutter.dev/cookbook/networking/fetch-data" rel="nofollow noreferrer">this tutorial</a> from flutter.dev</li>
<li>Afterwards it should be easy for you to change the code. Instead of <code>class Album</code> you want to have <code>class CurrentBackendTime</code>. Instead of the function <code>&lt;Future&gt;Album fetchAlbum()</code> you want to have <code>&lt;Future&gt;CurrentBackendTime fetchCurrentBackendTime()</code> and so on. From the <a href="https://docs.blockfrost.io/#tag/Health/paths/%7E1health%7E1clock/get" rel="nofollow noreferrer">API-Docs for GET /health/clock</a> you can learn how to parse data from JSON, which datatypes are required and what data you will get.</li>
<li>Since GET /health/clock requires authentication (see API-Docs again) you need to create an HTTP-Header within your <code>&lt;Future&gt;CurrentBackendTime fetchCurrentBackendTime()</code> function:
<pre><code>final Map&lt;String, String&gt; authHeader = Map&lt;String, String&gt;();
authHeader['project_id'] = 'PUT YOUR BLOCKFROST API KEY IN HERE!'
</code></pre>
and then you just add the header to your <code>http.get()</code>-Call:
<pre><code>final response = await http.get(
 Uri.parse('https://cardano-mainnet.blockfrost.io/api/v0/health/clock'),
 headers: authHeader,
);
</code></pre>
</li>
<li>You could now create more classes like <code>class AccountRewardHistory</code>, <code>class AddressDetails</code> for all the objects you want to GET from blockfrost's API. Or you just use what you've learnt, and apply it when using a library like blockfrost.</li>
</ol>

CC BY-SA 4.0
2022-02-16T22:42:02.900Z
2022-02-18T02:06:02.210Z
2022-02-18T02:06:02.210Z
Dani_Rango
<p>Did anybody succeed with building a Flutter App that can communicate with the Cardano Blockchain? I would be happy if I could get some more guidance.</p>
<p>I'm trying to build a cross-platform Dapp, so I do not want to rely on running a full node. So Blockfrost.io comes in handy. Unfortunately there seems to be <a href="https://docs.blockfrost.io/#section/SDKs" rel="nofollow noreferrer">no official Dart Package</a>.</p>
<p>I've already tried with <a href="https://pub.dev/packages/blockfrost" rel="nofollow noreferrer">this blockfrost package</a> but somehow I did not manage to put everything together correctly. Did it work for any of you?</p>
<p>I wanted to reach out before I try to build Flutter-Plugins for Android and iOS using the official Java-/Kotlin-/Swift-SDKs provided by Blockfrost.</p>

CC BY-SA 4.0
2022-02-12T07:07:02.627Z
It appears that blockfrost is having a few issues atm. A blockfrost dev commented on my question here https://cardano.stackexchange.com/questions/6934/ppviewhashesdontmatch-and-unspendableutxonodatumhash-error-on-redeeming-funds-fr?noredirect=1#comment3186_6934.
Roofi
CC BY-SA 4.0
2022-02-12T13:20:40.633Z
That's not what I'm facing. It's not that I get errors from Blockfrost API. I'm struggling to setup the communication in the first place. I might have to ask that question in a Flutter-specific forum maybe.

Anyway I thought maybe someone can help. If not I will update this post and let others know.
Dani_Rango
<decentralized-applications><blockfrost>
How can I establish the communication between my Flutter App and Cardano Blockchain?
# How can I establish the communication between my Flutter App and Cardano Blockchain?

(Asked by: username_0 on 2022-02-11)

Did anybody succeed with building a Flutter App that can communicate with the Cardano Blockchain? I would be happy if I could get some more guidance.

I'm trying to build a cross-platform Dapp, so I do not want to rely on running a full node. So Blockfrost.io comes in handy. Unfortunately there seems to be [no official Dart Package](https://docs.blockfrost.io/#section/SDKs).

I've already tried with [this blockfrost package](https://pub.dev/packages/blockfrost) but somehow I did not manage to put everything together correctly. Did it work for any of you?

I wanted to reach out before I try to build Flutter-Plugins for Android and iOS using the official Java-/Kotlin-/Swift-SDKs provided by Blockfrost.

**Tags:** decentralized-applications, blockfrost
> **Comments:**
> **username_1**: It appears that blockfrost is having a few issues atm. A blockfrost dev commented on my question here https://cardano.stackexchange.com/questions/6934/ppviewhashesdontmatch-and-unspendableutxonodatumhash-error-on-redeeming-funds-fr?noredirect=1#comment3186_6934.  
> **username_0**: That's not what I'm facing. It's not that I get errors from Blockfrost API. I'm struggling to setup the communication in the first place. I might have to ask that question in a Flutter-specific forum maybe.  Anyway I thought maybe someone can help. If not I will update this post and let others know.  

---

## 2 answers

### Answer by username_2 on 2022-02-13. Score: 0 | Accepted answer

I would check out this package, <https://pub.dev/packages/blockfrost>. I know this package is being used in at least one place for the Manzano app which can be found here, <https://manzano.studio/#/>

> **Comments:**
> **username_0**: This is the correct answer. Use the library. I just struggled with the setup. If others struggle with Flutter/Cardano aswell I'm answering what I've been doing to get things going.  

---

### Answer by username_0 on 2022-02-16. Score: 0

I got it working for me, these steps may work for you.

Work through this tutorial from flutter.dev
Afterwards it should be easy for you to change the code. Instead of class Album you want to have class CurrentBackendTime. Instead of the function Album fetchAlbum() you want to have CurrentBackendTime fetchCurrentBackendTime() and so on. From the API-Docs for GET /health/clock you can learn how to parse data from JSON, which datatypes are required and what data you will get.
Since GET /health/clock requires authentication (see API-Docs again) you need to create an HTTP-Header within your CurrentBackendTime fetchCurrentBackendTime() function:
final Map authHeader = Map();
authHeader['project_id'] = 'PUT YOUR BLOCKFROST API KEY IN HERE!'

and then you just add the header to your http.get()-Call:
final response = await http.get(
 Uri.parse('https://cardano-mainnet.blockfrost.io/api/v0/health/clock'),
 headers: authHeader,
);


You could now create more classes like class AccountRewardHistory, class AddressDetails for all the objects you want to GET from blockfrost's API. Or you just use what you've learnt, and apply it when using a library like blockfrost.


---

