onInit method

  1. @override
void onInit()
override

Called immediately after the widget is allocated in memory. You might use this to initialize something for the controller.

Implementation

@override
void onInit() {
  super.onInit();
  player.onPlayerComplete.listen((event) {
    playingChat!.mediaChatMessage!.isPlaying = false;
    playingChat!.mediaChatMessage!.currentPos = 0;
    player.stop();
    //chatList.refresh();
  });

  player.onDurationChanged.listen((Duration p) {
    playingChat?.mediaChatMessage!.currentPos = (p.inMilliseconds);
    //chatList.refresh();
  });
}