idk
This commit is contained in:
parent
5b83ec4bbf
commit
9531a112d4
|
|
@ -72,7 +72,7 @@ class AiApiService {
|
||||||
|
|
||||||
mimeType = file.isAudio()
|
mimeType = file.isAudio()
|
||||||
? file.isRecorded
|
? file.isRecorded
|
||||||
? 'audio/${kIsWeb && AppInitializer.getOperatingSystem() == 'iOS' ? 'webm' : 'm4a'}'
|
? 'audio/m4a}'
|
||||||
: 'audio/${file.extname.replaceAll('.', '')}'
|
: 'audio/${file.extname.replaceAll('.', '')}'
|
||||||
: file.isImage()
|
: file.isImage()
|
||||||
? 'image/png'
|
? 'image/png'
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:path_provider/path_provider.dart';
|
import 'package:path_provider/path_provider.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:url_launcher/url_launcher_string.dart';
|
import 'package:url_launcher/url_launcher_string.dart';
|
||||||
import 'dart:html' as html;
|
|
||||||
|
|
||||||
class AppInitializer {
|
class AppInitializer {
|
||||||
static String? fcmToken;
|
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 {
|
static Future<SettingsData> initilizeSettings() async {
|
||||||
try {
|
try {
|
||||||
final brightness = await StorageService.getValue(key: 'brightness');
|
final brightness = await StorageService.getValue(key: 'brightness');
|
||||||
|
|
|
||||||
|
|
@ -75,13 +75,6 @@ class FirebaseApi {
|
||||||
if (kDebugMode) {
|
if (kDebugMode) {
|
||||||
print("forground: ${NotificationData.fromJson(message.data).toJson()}");
|
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 {
|
try {
|
||||||
await NotificationService.showFirebaseNotification(message);
|
await NotificationService.showFirebaseNotification(message);
|
||||||
|
|
|
||||||
|
|
@ -348,7 +348,7 @@ class _AiMessageBarState extends State<AiMessageBar> {
|
||||||
state.file = FilesModel(
|
state.file = FilesModel(
|
||||||
path.toString(),
|
path.toString(),
|
||||||
name:
|
name:
|
||||||
'${DateTime.now().millisecondsSinceEpoch ~/ 1000}.${kIsWeb && AppInitializer.getOperatingSystem() == 'iOS' ? 'webm' : 'm4a'}',
|
'${DateTime.now().millisecondsSinceEpoch ~/ 1000}.m4a',
|
||||||
isRecorded: true,
|
isRecorded: true,
|
||||||
audio: true,
|
audio: true,
|
||||||
image: false,
|
image: false,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue