-
-
Save sbis04/2d9fad03931418352f851968f26bef96 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Expanded( | |
child: FutureBuilder<AssetData>( | |
future: _muxClient.getAssetList(), | |
builder: (context, snapshot) { | |
if (snapshot.hasData) { | |
AssetData assetData = snapshot.data; | |
int length = assetData.data.length; | |
return ListView.separated( | |
physics: BouncingScrollPhysics(), | |
itemCount: length, | |
itemBuilder: (context, index) { | |
DateTime dateTime = DateTime.fromMillisecondsSinceEpoch( | |
int.parse(assetData.data[index].createdAt) * 1000); | |
DateFormat formatter = DateFormat.yMd().add_jm(); | |
String dateTimeString = formatter.format(dateTime); | |
String currentStatus = assetData.data[index].status; | |
bool isReady = currentStatus == 'ready'; | |
String playbackId = isReady | |
? assetData.data[index].playbackIds[0].id | |
: null; | |
String thumbnailURL = isReady | |
? '$muxImageBaseUrl/$playbackId/$imageTypeSize' | |
: null; | |
return VideoTile( | |
assetData: assetData.data[index], | |
thumbnailUrl: thumbnailURL, | |
isReady: isReady, | |
dateTimeString: dateTimeString, | |
); | |
}, | |
separatorBuilder: (_, __) => SizedBox( | |
height: 16.0, | |
), | |
); | |
} | |
return Container( | |
child: Text( | |
'No videos present', | |
style: TextStyle( | |
color: Colors.black45, | |
), | |
), | |
); | |
}, | |
), | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment