feat: Gemini AI (doc OCR + face match) + role-assignment endpoints
- GeminiService (integrations/gemini, @Global): extractDocument (OCR fields) + faceMatch; graceful if no GEMINI_API_KEY - documents: face-match now real via Gemini; POST /admin/documents/:id/ocr extracts fields for CS auto-fill - roles: PATCH /admin/users/:id/role (admin) + POST /platform/users/role (bootstrap via x-platform-secret) - config: gemini + platform.secret; .env.example entries Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:just_audio/just_audio.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class AudioController extends GetxController {
|
||||
final AudioPlayer _audioPlayer = AudioPlayer();
|
||||
|
||||
Future<void> playAudio() async {
|
||||
// Check if the platform is Android
|
||||
if (Theme.of(Get.context!).platform == TargetPlatform.android) {
|
||||
try {
|
||||
// Load the audio file from the raw resources
|
||||
await _audioPlayer.setAsset(
|
||||
'assets/order1.wav'); // Adjust the path based on your project structure
|
||||
_audioPlayer.play();
|
||||
} catch (e) {
|
||||
// Handle errors, such as file not found
|
||||
print('Error playing audio: $e');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> playAudio1(String path) async {
|
||||
// Check if the platform is Android
|
||||
// if (Theme.of(Get.context!).platform == TargetPlatform.android) {
|
||||
try {
|
||||
// Load the audio file from the raw resources
|
||||
await _audioPlayer
|
||||
.setAsset(path); // Adjust the path based on your project structure
|
||||
_audioPlayer.play();
|
||||
} catch (e) {
|
||||
// Handle errors, such as file not found
|
||||
print('Error playing audio: $e');
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
// Release resources when done
|
||||
_audioPlayer.dispose();
|
||||
super.onClose();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user