import 'package:flutter/material.dart'; extension SolianCallExt on BuildContext { Future showPublishDialog() => showDialog( context: this, builder: (ctx) => AlertDialog( title: const Text('Publish'), content: const Text('Would you like to publish your Camera & Mic ?'), actions: [ TextButton( onPressed: () => Navigator.pop(ctx, false), child: const Text('NO'), ), TextButton( onPressed: () => Navigator.pop(ctx, true), child: const Text('YES'), ), ], ), ); Future showPlayAudioManuallyDialog() => showDialog( context: this, builder: (ctx) => AlertDialog( title: const Text('Play Audio'), content: const Text( 'You need to manually activate audio PlayBack for iOS Safari !'), actions: [ TextButton( onPressed: () => Navigator.pop(ctx, false), child: const Text('Ignore'), ), TextButton( onPressed: () => Navigator.pop(ctx, true), child: const Text('Play Audio'), ), ], ), ); Future showUnPublishDialog() => showDialog( context: this, builder: (ctx) => AlertDialog( title: const Text('UnPublish'), content: const Text('Would you like to un-publish your Camera & Mic ?'), actions: [ TextButton( onPressed: () => Navigator.pop(ctx, false), child: const Text('NO'), ), TextButton( onPressed: () => Navigator.pop(ctx, true), child: const Text('YES'), ), ], ), ); Future showErrorDialog(dynamic exception) => showDialog( context: this, builder: (ctx) => AlertDialog( title: const Text('Error'), content: Text(exception.toString()), actions: [ TextButton( onPressed: () => Navigator.pop(ctx), child: const Text('OK'), ) ], ), ); Future showDisconnectDialog() => showDialog( context: this, builder: (ctx) => AlertDialog( title: const Text('Disconnect'), content: const Text('Are you sure to disconnect?'), actions: [ TextButton( onPressed: () => Navigator.pop(ctx, false), child: const Text('Cancel'), ), TextButton( onPressed: () => Navigator.pop(ctx, true), child: const Text('Disconnect'), ), ], ), ); Future showReconnectDialog() => showDialog( context: this, builder: (ctx) => AlertDialog( title: const Text('Reconnect'), content: const Text('This will force a reconnection'), actions: [ TextButton( onPressed: () => Navigator.pop(ctx, false), child: const Text('Cancel'), ), TextButton( onPressed: () => Navigator.pop(ctx, true), child: const Text('Reconnect'), ), ], ), ); Future showReconnectSuccessDialog() => showDialog( context: this, builder: (ctx) => AlertDialog( title: const Text('Reconnect'), content: const Text('Reconnection was successful.'), actions: [ TextButton( onPressed: () => Navigator.pop(ctx), child: const Text('OK'), ), ], ), ); Future showSendDataDialog() => showDialog( context: this, builder: (ctx) => AlertDialog( title: const Text('Send data'), content: const Text( 'This will send a sample data to all participants in the room'), actions: [ TextButton( onPressed: () => Navigator.pop(ctx, false), child: const Text('Cancel'), ), TextButton( onPressed: () => Navigator.pop(ctx, true), child: const Text('Send'), ), ], ), ); Future showDataReceivedDialog(String data) => showDialog( context: this, builder: (ctx) => AlertDialog( title: const Text('Received data'), content: Text(data), actions: [ TextButton( onPressed: () => Navigator.pop(ctx, true), child: const Text('OK'), ), ], ), ); Future showRecordingStatusChangedDialog(bool isActiveRecording) => showDialog( context: this, builder: (ctx) => AlertDialog( title: const Text('Room recording reminder'), content: Text(isActiveRecording ? 'Room recording is active.' : 'Room recording is stoped.'), actions: [ TextButton( onPressed: () => Navigator.pop(ctx, true), child: const Text('OK'), ), ], ), ); Future showSubscribePermissionDialog() => showDialog( context: this, builder: (ctx) => AlertDialog( title: const Text('Allow subscription'), content: const Text( 'Allow all participants to subscribe tracks published by local participant?'), actions: [ TextButton( onPressed: () => Navigator.pop(ctx, false), child: const Text('NO'), ), TextButton( onPressed: () => Navigator.pop(ctx, true), child: const Text('YES'), ), ], ), ); } enum SimulateScenarioResult { signalReconnect, fullReconnect, speakerUpdate, nodeFailure, migration, serverLeave, switchCandidate, e2eeKeyRatchet, participantName, participantMetadata, clear, }