chore: Update SDK

This commit is contained in:
Christian Pauly 2022-06-20 15:35:22 +02:00
commit 24ee341670
12 changed files with 94 additions and 46 deletions

View file

@ -399,6 +399,19 @@ class ChatController extends State<Chat> {
}
void voiceMessageAction() async {
if (PlatformInfos.isAndroid) {
final info = await DeviceInfoPlugin().androidInfo;
if ((info.version.sdkInt ?? 16) < 19) {
showOkAlertDialog(
context: context,
title: L10n.of(context)!.unsupportedAndroidVersion,
message: L10n.of(context)!.unsupportedAndroidVersionLong,
okLabel: L10n.of(context)!.close,
);
return;
}
}
if (await Record().hasPermission() == false) return;
final result = await showDialog<RecordingResult>(
context: context,

View file

@ -246,7 +246,8 @@ class ChatInputRow extends StatelessWidget {
),
),
),
if (PlatformInfos.isMobile && controller.inputText.isEmpty)
if (PlatformInfos.platformCanRecord &&
controller.inputText.isEmpty)
Container(
height: 56,
alignment: Alignment.center,

View file

@ -33,7 +33,7 @@ class _RecordingDialogState extends State<RecordingDialog> {
final List<double> amplitudeTimeline = [];
static const int bitRate = 64000;
static const double samplingRate = 22050.0;
static const int samplingRate = 22050;
Future<void> startRecording() async {
try {
@ -49,7 +49,6 @@ class _RecordingDialogState extends State<RecordingDialog> {
await Wakelock.enable();
await _audioRecorder.start(
path: _recordedPath,
encoder: AudioEncoder.AAC,
bitRate: bitRate,
samplingRate: samplingRate,
);

View file

@ -193,8 +193,8 @@ class _MyCallingPage extends State<Calling> {
final call = this.call;
if (call == null) return;
call.onCallStateChanged.listen(_handleCallState);
call.onCallEventChanged.listen((event) {
call.onCallStateChanged.stream.listen(_handleCallState);
call.onCallEventChanged.stream.listen((event) {
if (event == CallEvent.kFeedsChanged) {
setState(() {
call.tryRemoveStopedStreams();