Flutter app error - type 'Timestamp' is not a subtype of type 'DateTime'

后端 未结 14 1436
刺人心
刺人心 2020-12-16 12:49

I\'m fetching data cloud firestore & trying to show in my app by using the following piece of code.

new Text(timeago.format(document.data[\'tripDoc\'][\'         


        
14条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-16 13:20

    I think this is more reliable

    DateTime updateDateTime = DateTime.fromMillisecondsSinceEpoch(
            map['updatedatetime'].millisecondsSinceEpoch);
    

提交回复
热议问题