|
|
@ -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);
|
|
|
|
SheetAction(
|
|
|
|
},
|
|
|
|
label: L10n.of(context)!.videoCall,
|
|
|
|
),
|
|
|
|
icon: Icons.video_call_outlined,
|
|
|
|
ListTile(
|
|
|
|
key: CallType.kVideo,
|
|
|
|
leading: const Icon(Icons.videocam),
|
|
|
|
),
|
|
|
|
title: Text(L10n.of(context)!.videoCall),
|
|
|
|
],
|
|
|
|
onTap: () {
|
|
|
|
);
|
|
|
|
Navigator.pop(context, CallType.kVideo);
|
|
|
|
if (callType == null) return;
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
ListTile(
|
|
|
|
|
|
|
|
leading: const Icon(Icons.cancel),
|
|
|
|
|
|
|
|
title: Text(L10n.of(context)!.cancel),
|
|
|
|
|
|
|
|
onTap: () {
|
|
|
|
|
|
|
|
Navigator.pop(context, null);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
useRootNavigator: false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (callType == null) {
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
final success = await showFutureLoadingDialog(
|
|
|
|
final success = await showFutureLoadingDialog(
|
|
|
|
context: context,
|
|
|
|
context: context,
|
|
|
|
future: () =>
|
|
|
|
future: () =>
|
|
|
|