المجلدات وأسماء حزم dart واستيراداتها: siro_rider → intaleq_rider siro_driver → intaleq_driver siro_admin → intaleq_admin siro_service → intaleq_service شمل ذلك `name:` في كل pubspec وكل `package:siro_*` في الاستيرادات (115 ملفاً في rider وحده)، وإشارات أسماء المجلدات في docs/ وتعليق في backend/Admin/notifications/broadcast.php. لم تبقَ إشارة واحدة (تحقّقت). + ضُمّت حزم get و get_storage داخل intaleq_driver/packages/ وحُوّلت مساراتها الثلاثة من `../../Intaleq/packages/*` إلى `./packages/*`. كانت تُحل عرضاً إلى مجلد App/Intaleq القديم المجاور — تبعية خارج المستودع تنكسر بأول نقل. لم يبقَ في أي تطبيق تبعية مسار خارج الشجرة. ⚠️ لم تُمسّ بعد: هويات المتاجر (applicationId · PRODUCT_BUNDLE_IDENTIFIER · shorebird app_id) ولا الألوان ولا النصوص المرئية ولا النطاقات — كل منها كوميت منفصل، والهويات تحتاج قرار المالك. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
45 lines
1.3 KiB
Dart
Executable File
45 lines
1.3 KiB
Dart
Executable File
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();
|
|
}
|
|
}
|