* Add macOS support * Update README * Update to v0.2.0 * Document breaking changes * Delete widget tests
46 lines
1.0 KiB
Dart
46 lines
1.0 KiB
Dart
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> darwinSteps = [
|
|
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 || Platform.isMacOS) ...darwinSteps,
|
|
];
|
|
|
|
int get step {
|
|
return steps.indexOf(this);
|
|
}
|
|
}
|