-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(lib): events are now mixin class
- Loading branch information
1 parent
406e1c8
commit 26bfd33
Showing
5 changed files
with
114 additions
and
118 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,22 @@ | ||
import 'dart:ui'; | ||
|
||
class ApiVideoLiveStreamEventsListener { | ||
mixin class ApiVideoLiveStreamEventsListener { | ||
/// Gets notified when the connection is successful | ||
final VoidCallback? onConnectionSuccess; | ||
void onConnectionSuccess() {} | ||
|
||
/// Gets notified when the connection failed | ||
final Function(String)? onConnectionFailed; | ||
void onConnectionFailed(String reason) {} | ||
|
||
/// Gets notified when the device has been disconnected | ||
final VoidCallback? onDisconnection; | ||
void onDisconnection() {} | ||
|
||
/// Gets notified when the video size has changed. Mostly designed to update Widget aspect ratio. | ||
final Function(Size)? onVideoSizeChanged; | ||
void onVideoSizeChanged(Size size) {} | ||
|
||
/// Gets notified when an error occurs | ||
final Function(Exception)? onError; | ||
|
||
ApiVideoLiveStreamEventsListener( | ||
{this.onConnectionSuccess, | ||
this.onConnectionFailed, | ||
this.onDisconnection, | ||
this.onVideoSizeChanged, | ||
this.onError}); | ||
void onError(Exception error) {} | ||
} | ||
|
||
class ApiVideoLiveStreamWidgetListener { | ||
final VoidCallback? onTextureReady; | ||
|
||
ApiVideoLiveStreamWidgetListener({this.onTextureReady}); | ||
mixin class ApiVideoLiveStreamWidgetListener { | ||
void onTextureReady() {} | ||
} |