您好我实际上使用http请求在Firebase for Firebase上运行了REST api,但现在我需要实时同步数据请求功能.我读了一些关于web套接字的东西.
有没有办法在Cloud Functions for Firebase上运行Web套接字?
我正在做类似于这个视频的事情:https : //youtu.be/fpqHUp4Sag0
使用以下代码生成列表视图,但是当以这种方式使用控制器时,元素位于列表视图的顶部,我需要将其居中
Widget _buildLyric() {
return ListView.builder(
itemBuilder: (BuildContext context, int index) => _buildPhrase(lyric[index]),
itemCount: lyric.length,
itemExtent: 90.0,
controller: _scrollController,
);
}
void goToNext() {
i += 1;
if (i == lyric.length - 1) {
setState(() {
finishedSync = true;
});
}
syncLyric.addPhrase(
lyric[i], playerController.value.position.inMilliseconds);
_scrollController.animateTo(i*90.0,
curve: Curves.ease, duration: new Duration(milliseconds: 300));
}
Run Code Online (Sandbox Code Playgroud) 嗨,我正在使用颤振视频播放器插件,我有类似的东西,有[{phrase:"something", startAt: 1039}, {phrase:"other somthing", startAt: 26500}]没有办法在 ui 中根据视频播放时的开始时间更改短语。
我尝试使用持续时间为 100 毫秒的计时器,但我没有从 Flutter 视频播放器插件中检索到确切的时间。