showConnectDialog method

void showConnectDialog(
  1. {required BuildContext context,
  2. required WidgetRef ref,
  3. required AppModel appModel}
)

Dialog for menu action.

Implementation

void showConnectDialog(
    {required BuildContext context,
    required WidgetRef ref,
    required AppModel appModel}) async {
  if (isActive) {
    showDisconnectPrompt(
      context: context,
      ref: ref,
      appModel: appModel,
    );
  } else {
    await showDialog(
      context: context,
      builder: (context) => WebsocketDialogPage(
        address: lastAddress,
        onConnect: (address) {
          Navigator.pop(context);
          setLastAddress(address);
          setServerAddress(
            address: address,
          );

          mediaType.refreshTab();
          _controller.add(null);
        },
      ),
    );
  }
}