mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2025-01-12 02:32:54 +01:00
chore: Adjust start video call UX
This commit is contained in:
parent
ddecffa531
commit
890db2bc45
@ -2729,5 +2729,6 @@
|
|||||||
"placeCall": "Place call",
|
"placeCall": "Place call",
|
||||||
"voiceCall": "Voice call",
|
"voiceCall": "Voice call",
|
||||||
"unsupportedAndroidVersion": "Unsupported Android version",
|
"unsupportedAndroidVersion": "Unsupported Android version",
|
||||||
"unsupportedAndroidVersionLong": "This feature required a never Android version. Please check for updates or Lineage OS support."
|
"unsupportedAndroidVersionLong": "This feature required a never Android version. Please check for updates or Lineage OS support.",
|
||||||
|
"videoCallsBetaWarning": "Please note that video calls are currently in beta. They might not work as expected or work at all on all platforms."
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,6 @@ import 'package:flutter/scheduler.dart';
|
|||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
|
||||||
import 'package:adaptive_dialog/adaptive_dialog.dart';
|
import 'package:adaptive_dialog/adaptive_dialog.dart';
|
||||||
import 'package:animations/animations.dart';
|
|
||||||
import 'package:desktop_drop/desktop_drop.dart';
|
import 'package:desktop_drop/desktop_drop.dart';
|
||||||
import 'package:device_info_plus/device_info_plus.dart';
|
import 'package:device_info_plus/device_info_plus.dart';
|
||||||
import 'package:emoji_picker_flutter/emoji_picker_flutter.dart';
|
import 'package:emoji_picker_flutter/emoji_picker_flutter.dart';
|
||||||
@ -959,56 +958,34 @@ class ChatController extends State<Chat> {
|
|||||||
DeviceInfoPlugin().androidInfo.then((value) {
|
DeviceInfoPlugin().androidInfo.then((value) {
|
||||||
if ((value.version.sdkInt ?? 16) < 21) {
|
if ((value.version.sdkInt ?? 16) < 21) {
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
showModal(
|
showOkAlertDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) => AlertDialog(
|
title: L10n.of(context)!.unsupportedAndroidVersion,
|
||||||
title: Text(L10n.of(context)!.unsupportedAndroidVersion),
|
message: L10n.of(context)!.unsupportedAndroidVersionLong,
|
||||||
content: Text(L10n.of(context)!.unsupportedAndroidVersionLong),
|
okLabel: L10n.of(context)!.close,
|
||||||
actions: [
|
|
||||||
TextButton(
|
|
||||||
onPressed: Navigator.of(context).pop,
|
|
||||||
child: Text(L10n.of(context)!.ok))
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
final callType = await showDialog<CallType>(
|
final callType = await showModalActionSheet<CallType>(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) {
|
title: L10n.of(context)!.videoCallsBetaWarning,
|
||||||
return SimpleDialog(
|
cancelLabel: L10n.of(context)!.cancel,
|
||||||
title: Text(L10n.of(context)!.placeCall),
|
actions: [
|
||||||
children: [
|
SheetAction(
|
||||||
ListTile(
|
label: L10n.of(context)!.voiceCall,
|
||||||
leading: const Icon(Icons.phone),
|
icon: Icons.phone_outlined,
|
||||||
title: Text(L10n.of(context)!.voiceCall),
|
key: CallType.kVoice,
|
||||||
onTap: () {
|
|
||||||
Navigator.pop(context, CallType.kVoice);
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
ListTile(
|
SheetAction(
|
||||||
leading: const Icon(Icons.videocam),
|
label: L10n.of(context)!.videoCall,
|
||||||
title: Text(L10n.of(context)!.videoCall),
|
icon: Icons.video_call_outlined,
|
||||||
onTap: () {
|
key: CallType.kVideo,
|
||||||
Navigator.pop(context, CallType.kVideo);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
ListTile(
|
|
||||||
leading: const Icon(Icons.cancel),
|
|
||||||
title: Text(L10n.of(context)!.cancel),
|
|
||||||
onTap: () {
|
|
||||||
Navigator.pop(context, null);
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
},
|
if (callType == null) return;
|
||||||
useRootNavigator: false);
|
|
||||||
|
|
||||||
if (callType == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
final success = await showFutureLoadingDialog(
|
final success = await showFutureLoadingDialog(
|
||||||
context: context,
|
context: context,
|
||||||
future: () =>
|
future: () =>
|
||||||
|
@ -122,7 +122,7 @@ class ChatView extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
IconButton(
|
IconButton(
|
||||||
onPressed: controller.onPhoneButtonTap,
|
onPressed: controller.onPhoneButtonTap,
|
||||||
icon: const Icon(Icons.phone),
|
icon: const Icon(Icons.call_outlined),
|
||||||
tooltip: L10n.of(context)!.placeCall,
|
tooltip: L10n.of(context)!.placeCall,
|
||||||
),
|
),
|
||||||
EncryptionButton(controller.room!),
|
EncryptionButton(controller.room!),
|
||||||
|
Loading…
Reference in New Issue
Block a user