feat(example_full): create example representing the whole plugin functional
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
import 'dart:io';
|
||||
|
||||
enum AppState {
|
||||
idle,
|
||||
permissions,
|
||||
checkServices,
|
||||
selectClientType,
|
||||
readyToDiscover,
|
||||
discoveringPeers,
|
||||
streamingPeers,
|
||||
loadingConnection,
|
||||
connected,
|
||||
communicationChannelCreated;
|
||||
|
||||
static final List<AppState> androidSteps = [
|
||||
AppState.idle,
|
||||
AppState.permissions,
|
||||
AppState.checkServices,
|
||||
AppState.readyToDiscover,
|
||||
AppState.discoveringPeers,
|
||||
AppState.streamingPeers,
|
||||
AppState.loadingConnection,
|
||||
AppState.connected,
|
||||
AppState.communicationChannelCreated,
|
||||
];
|
||||
static final List<AppState> iosSteps = [
|
||||
AppState.idle,
|
||||
AppState.selectClientType,
|
||||
AppState.readyToDiscover,
|
||||
AppState.discoveringPeers,
|
||||
AppState.streamingPeers,
|
||||
AppState.loadingConnection,
|
||||
AppState.connected,
|
||||
AppState.communicationChannelCreated,
|
||||
];
|
||||
|
||||
static final List<AppState> steps = [
|
||||
if (Platform.isAndroid) ...androidSteps,
|
||||
if (Platform.isIOS) ...iosSteps,
|
||||
];
|
||||
|
||||
int get step {
|
||||
return steps.indexOf(this);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user