feat: استيراد كود سيرو إلى تريبز (سيرو @ecfe7568) — بلا تعديل
قرار المالك 2026-07-27: باك إند سيرو PHP هو المعتمد، وتطبيقاته المجرّبة ميدانياً تحل محل إعادة البناء المؤرشفة. سيرو نفسه لم يُمسّ. الخريطة: backend · payment_server · loction_server · ride_server · passenger_server · docker · dashboard · stress_test → الجذر siro_rider → apps/rider siro_driver → apps/driver siro_admin → dashboards/admin siro_service → dashboards/service android_bot → apps/android_bot socialBot → apps/socialBot نُسخ المتعقَّب في git سيرو فقط عبر `git archive` (3,198 ملفاً / ~169 م.ب) لا `cp -r` — فاستُثنيت مخلفات البناء تلقائياً. بلا أي تعديل محتوى عمداً: كل ما يلي يصير فرقاً مقروءاً مقابل المصدر. لم يُستورد وسببه: siromove.com (الموقع التسويقي يبقى marketing/ في تريبز، سيرو فيه 8 ملفات) · docs و planning (تريبز له docs/ الخاص) · deploy.sh (ليس نشراً على سيرفر بل `git add . && git push origin --all` — فخّ في مستودع آخر) · transit_dashboard (بانتظار قرار مصير backend-transit و dashboards/transit-web). ⚠️ لا يبني بعد — ثلاثة نواقص متوقعة ومقصودة: 1. `.env` و `lib/env/env.g.dart` غير متعقَّبين في سيرو (أسرار لكل مستأجر): كل تطبيق فلاتر يحتاج .env خاصاً ثم توليد env.g.dart بـ build_runner. 2. إعدادات Firebase (9 ملفات google-services.json و GoogleService-Info.plist) يستبعدها .gitignore تريبز — ولكل مستأجر مشروع Firebase خاص أصلاً. 3. apps/driver في سيرو يشير إلى `../../Intaleq/packages/get` خارج المستودع → يجب ضمّ الحزم داخله أسوة بـ apps/rider. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
9909d9b4c1
commit
4d8414c96b
@@ -0,0 +1,290 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../constant/colors.dart';
|
||||
import '../../constant/style.dart';
|
||||
import '../../controller/voice_call_controller.dart';
|
||||
|
||||
class VoiceCallBottomSheet extends StatelessWidget {
|
||||
const VoiceCallBottomSheet({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final controller = Get.find<VoiceCallController>();
|
||||
final double screenHeight = MediaQuery.of(context).size.height;
|
||||
final bool isDark = Theme.of(context).brightness == Brightness.dark;
|
||||
|
||||
// Harmonious curated colors
|
||||
final Color bgColor = isDark ? const Color(0xFF121212) : Colors.white;
|
||||
final Color cardColor = isDark ? const Color(0xFF1E1E1E) : const Color(0xFFF5F5F7);
|
||||
final Color textColor = isDark ? Colors.white : const Color(0xFF1C1C1E);
|
||||
final Color subTextColor = isDark ? Colors.white70 : Colors.black54;
|
||||
|
||||
return WillPopScope(
|
||||
onWillPop: () async => false,
|
||||
child: Container(
|
||||
height: screenHeight * 0.9,
|
||||
decoration: BoxDecoration(
|
||||
color: bgColor,
|
||||
borderRadius: const BorderRadius.vertical(top: Radius.circular(32)),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.2),
|
||||
blurRadius: 20,
|
||||
offset: const Offset(0, -5),
|
||||
)
|
||||
],
|
||||
),
|
||||
child: Obx(() {
|
||||
final state = controller.state.value;
|
||||
final seconds = controller.elapsedSeconds.value;
|
||||
final remoteName = controller.remoteName.value;
|
||||
final isMuted = controller.isMuted.value;
|
||||
final isSpeakerOn = controller.isSpeakerOn.value;
|
||||
|
||||
// Progress ring logic
|
||||
final double progress = seconds / 60.0;
|
||||
final Color ringColor = seconds > 10 ? const Color(0xFF2ECC71) : const Color(0xFFE74C3C);
|
||||
|
||||
// Status text translations
|
||||
String statusText = "";
|
||||
switch (state) {
|
||||
case VoiceCallState.dialing:
|
||||
statusText = "${'Calling'.tr} $remoteName...";
|
||||
break;
|
||||
case VoiceCallState.ringing:
|
||||
statusText = "${'Captain'.tr} $remoteName ${'is calling you'.tr}...";
|
||||
break;
|
||||
case VoiceCallState.connecting:
|
||||
statusText = "Connecting...".tr;
|
||||
break;
|
||||
case VoiceCallState.active:
|
||||
statusText = "Call Connected".tr;
|
||||
break;
|
||||
case VoiceCallState.ended:
|
||||
statusText = "Call Ended".tr;
|
||||
break;
|
||||
case VoiceCallState.idle:
|
||||
statusText = "";
|
||||
break;
|
||||
}
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
// Top Drag Handle Indicator
|
||||
Center(
|
||||
child: Container(
|
||||
margin: const EdgeInsets.only(top: 12, bottom: 24),
|
||||
width: 44,
|
||||
height: 5,
|
||||
decoration: BoxDecoration(
|
||||
color: isDark ? Colors.white24 : Colors.black12,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 24),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
// Header Info
|
||||
Column(
|
||||
children: [
|
||||
Text(
|
||||
"Free Call".tr,
|
||||
style: TextStyle(
|
||||
color: ringColor,
|
||||
fontWeight: FontWeight.w800,
|
||||
fontSize: 14,
|
||||
letterSpacing: 1.2,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
remoteName,
|
||||
style: TextStyle(
|
||||
color: textColor,
|
||||
fontWeight: FontWeight.w900,
|
||||
fontSize: 26,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
statusText,
|
||||
style: TextStyle(
|
||||
color: subTextColor,
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
// Avatar & Animated Progress Ring
|
||||
Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
// Progress ring around avatar (Active state only)
|
||||
if (state == VoiceCallState.active)
|
||||
SizedBox(
|
||||
width: 172,
|
||||
height: 172,
|
||||
child: CircularProgressIndicator(
|
||||
value: progress,
|
||||
strokeWidth: 5,
|
||||
backgroundColor: isDark ? Colors.white10 : Colors.black12,
|
||||
valueColor: AlwaysStoppedAnimation<Color>(ringColor),
|
||||
),
|
||||
),
|
||||
|
||||
// Main Avatar Card
|
||||
Container(
|
||||
width: 150,
|
||||
height: 150,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: cardColor,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.08),
|
||||
blurRadius: 15,
|
||||
offset: const Offset(0, 8),
|
||||
)
|
||||
],
|
||||
),
|
||||
child: Center(
|
||||
child: remoteName.isNotEmpty
|
||||
? Text(
|
||||
remoteName[0].toUpperCase(),
|
||||
style: TextStyle(
|
||||
color: textColor,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 54,
|
||||
),
|
||||
)
|
||||
: Icon(
|
||||
Icons.person,
|
||||
color: textColor.withOpacity(0.6),
|
||||
size: 64,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
// Timer Counter Display
|
||||
if (state == VoiceCallState.active)
|
||||
Text(
|
||||
"0:${seconds.toString().padLeft(2, '0')}",
|
||||
style: TextStyle(
|
||||
color: seconds > 10 ? textColor : const Color(0xFFE74C3C),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 22,
|
||||
fontFamily: 'monospace',
|
||||
),
|
||||
)
|
||||
else
|
||||
const SizedBox(height: 24),
|
||||
|
||||
// Action Controls Block
|
||||
if (state == VoiceCallState.ringing)
|
||||
// Incoming Ringing Controls: Accept / Decline
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
_buildCircleActionButton(
|
||||
icon: Icons.call_end_rounded,
|
||||
color: Colors.white,
|
||||
bgColor: const Color(0xFFE74C3C),
|
||||
onTap: () => controller.declineCall(),
|
||||
label: "Decline".tr,
|
||||
),
|
||||
_buildCircleActionButton(
|
||||
icon: Icons.call_rounded,
|
||||
color: Colors.white,
|
||||
bgColor: const Color(0xFF2ECC71),
|
||||
onTap: () => controller.acceptCall(),
|
||||
label: "Accept".tr,
|
||||
),
|
||||
],
|
||||
)
|
||||
else
|
||||
// Dialing or Connected Controls: Speaker / Mute / Hangup
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
// Speakerphone toggle
|
||||
_buildCircleActionButton(
|
||||
icon: isSpeakerOn ? Icons.volume_up_rounded : Icons.volume_down_rounded,
|
||||
color: isSpeakerOn ? Colors.white : textColor,
|
||||
bgColor: isSpeakerOn ? const Color(0xFF2ECC71) : cardColor,
|
||||
onTap: () => controller.toggleSpeaker(),
|
||||
label: "Speaker".tr,
|
||||
),
|
||||
// Hangup Call
|
||||
_buildCircleActionButton(
|
||||
icon: Icons.call_end_rounded,
|
||||
color: Colors.white,
|
||||
bgColor: const Color(0xFFE74C3C),
|
||||
onTap: () => controller.hangup(),
|
||||
label: "End".tr,
|
||||
),
|
||||
// Mute Microphone
|
||||
_buildCircleActionButton(
|
||||
icon: isMuted ? Icons.mic_off_rounded : Icons.mic_rounded,
|
||||
color: isMuted ? Colors.white : textColor,
|
||||
bgColor: isMuted ? const Color(0xFFE74C3C) : cardColor,
|
||||
onTap: () => controller.toggleMute(),
|
||||
label: "Mute".tr,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildCircleActionButton({
|
||||
required IconData icon,
|
||||
required Color color,
|
||||
required Color bgColor,
|
||||
required VoidCallback onTap,
|
||||
required String label,
|
||||
}) {
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
ElevatedButton(
|
||||
onPressed: onTap,
|
||||
style: ElevatedButton.styleFrom(
|
||||
shape: const CircleBorder(),
|
||||
padding: const EdgeInsets.all(18),
|
||||
backgroundColor: bgColor,
|
||||
foregroundColor: color,
|
||||
elevation: 2,
|
||||
),
|
||||
child: Icon(icon, size: 28),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
label,
|
||||
style: const TextStyle(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.grey,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user