Benjaminvdm
Benjaminvdm

Reputation: 21

Parsing Json date in Flutter

I've been making an app for my student association and got it linked with a calendar api. My problem is that the starttime is in Json format.

At the moment I've imported it like this

title: Text("${userData[index]["start"]}",

I know there is an easy way to parse html to normal, but is this also possible with json? My datetime looks like this at the moment : {datetime:2020-05-13T19:00:00+02:00} at the moment.

Upvotes: 2

Views: 97

Answers (3)

Benjaminvdm
Benjaminvdm

Reputation: 21

Thanks guys! At least i lost the "datetime", now I have to figure out how to parse this: 020-05-13T19:00:00+02:00.

Upvotes: 0

Mahdi Bagheri
Mahdi Bagheri

Reputation: 23

You can also escape the double quotation with a backslash before that, like this :

title: Text("${userData[index][\"start\"]}",

Upvotes: 0

codercode
codercode

Reputation: 66

This may work

title: Text('${userData[index]["start"]["datetime"]}'),

Upvotes: 2

Related Questions