idk
This commit is contained in:
parent
5b83ec4bbf
commit
9531a112d4
|
|
@ -72,7 +72,7 @@ class AiApiService {
|
|||
|
||||
mimeType = file.isAudio()
|
||||
? file.isRecorded
|
||||
? 'audio/${kIsWeb && AppInitializer.getOperatingSystem() == 'iOS' ? 'webm' : 'm4a'}'
|
||||
? 'audio/m4a}'
|
||||
: 'audio/${file.extname.replaceAll('.', '')}'
|
||||
: file.isImage()
|
||||
? 'image/png'
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ import 'package:flutter/material.dart';
|
|||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:url_launcher/url_launcher_string.dart';
|
||||
import 'dart:html' as html;
|
||||
|
||||
class AppInitializer {
|
||||
static String? fcmToken;
|
||||
|
|
@ -42,24 +41,6 @@ class AppInitializer {
|
|||
});
|
||||
}
|
||||
|
||||
static String getOperatingSystem() {
|
||||
final userAgent = html.window.navigator.userAgent.toLowerCase();
|
||||
|
||||
if (userAgent.contains('windows')) {
|
||||
return 'Windows';
|
||||
} else if (userAgent.contains('mac os')) {
|
||||
return 'MacOS';
|
||||
} else if (userAgent.contains('iphone') || userAgent.contains('ipad')) {
|
||||
return 'iOS';
|
||||
} else if (userAgent.contains('android')) {
|
||||
return 'Android';
|
||||
} else if (userAgent.contains('linux')) {
|
||||
return 'Linux';
|
||||
} else {
|
||||
return 'Unknown';
|
||||
}
|
||||
}
|
||||
|
||||
static Future<SettingsData> initilizeSettings() async {
|
||||
try {
|
||||
final brightness = await StorageService.getValue(key: 'brightness');
|
||||
|
|
|
|||
|
|
@ -75,13 +75,6 @@ class FirebaseApi {
|
|||
if (kDebugMode) {
|
||||
print("forground: ${NotificationData.fromJson(message.data).toJson()}");
|
||||
}
|
||||
const platform = MethodChannel('com.didvan.didvanapp/notification');
|
||||
|
||||
await platform.invokeMethod('showNotification', {
|
||||
'title': message.notification!.title,
|
||||
'message': message.notification!.body
|
||||
});
|
||||
|
||||
// }
|
||||
try {
|
||||
await NotificationService.showFirebaseNotification(message);
|
||||
|
|
|
|||
|
|
@ -348,7 +348,7 @@ class _AiMessageBarState extends State<AiMessageBar> {
|
|||
state.file = FilesModel(
|
||||
path.toString(),
|
||||
name:
|
||||
'${DateTime.now().millisecondsSinceEpoch ~/ 1000}.${kIsWeb && AppInitializer.getOperatingSystem() == 'iOS' ? 'webm' : 'm4a'}',
|
||||
'${DateTime.now().millisecondsSinceEpoch ~/ 1000}.m4a',
|
||||
isRecorded: true,
|
||||
audio: true,
|
||||
image: false,
|
||||
|
|
|
|||
Loading…
Reference in New Issue