feat: Add Intaleq Native Android Kotlin & iOS Swift SDKs, Incline slope routing, Topographic contours and modular tactical app
This commit is contained in:
@@ -0,0 +1,194 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../models/navigation_state.dart';
|
||||
|
||||
class ActiveNavigationTopBanner extends StatelessWidget {
|
||||
final ActiveNavigationState navState;
|
||||
|
||||
const ActiveNavigationTopBanner({super.key, required this.navState});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final step = navState.currentStep;
|
||||
if (step == null) return const SizedBox.shrink();
|
||||
|
||||
return Positioned(
|
||||
top: 50,
|
||||
left: 16,
|
||||
right: 16,
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xF50F172A),
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
border: Border.all(color: const Color(0xFF0071E3), width: 1.5),
|
||||
boxShadow: const [
|
||||
BoxShadow(color: Colors.black87, blurRadius: 20, offset: Offset(0, 4)),
|
||||
],
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
// Maneuver Icon
|
||||
Container(
|
||||
padding: const EdgeInsets.all(10),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFF0071E3),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
boxShadow: const [
|
||||
BoxShadow(color: Color(0x660071E3), blurRadius: 8),
|
||||
],
|
||||
),
|
||||
child: Icon(step.icon, color: Colors.white, size: 28),
|
||||
),
|
||||
const SizedBox(width: 14),
|
||||
|
||||
// Instruction Text
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
'بعد ${step.distanceMeters.round()} متر',
|
||||
style: const TextStyle(
|
||||
color: Color(0xFF38BDF8),
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w900,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 2),
|
||||
Text(
|
||||
step.instructionAr,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 13.5,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
// Speed badge
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 6),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFF020617),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
border: Border.all(color: Colors.white12),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
navState.currentSpeedKmH.round().toString(),
|
||||
style: const TextStyle(
|
||||
color: Color(0xFF4ADE80),
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w900,
|
||||
),
|
||||
),
|
||||
const Text(
|
||||
'كم/س',
|
||||
style: TextStyle(color: Color(0xFF94A3B8), fontSize: 9),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class ActiveNavigationBottomHUD extends StatelessWidget {
|
||||
final ActiveNavigationState navState;
|
||||
final VoidCallback onStopNavigation;
|
||||
|
||||
const ActiveNavigationBottomHUD({
|
||||
super.key,
|
||||
required this.navState,
|
||||
required this.onStopNavigation,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final now = DateTime.now();
|
||||
final arrivalTime = now.add(Duration(minutes: navState.remainingDurationMinutes.round()));
|
||||
final hourStr = arrivalTime.hour.toString().padLeft(2, '0');
|
||||
final minStr = arrivalTime.minute.toString().padLeft(2, '0');
|
||||
|
||||
return Positioned(
|
||||
bottom: 20,
|
||||
left: 16,
|
||||
right: 16,
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xF50F172A),
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
border: Border.all(color: const Color(0xFF22C55E), width: 1.5),
|
||||
boxShadow: const [
|
||||
BoxShadow(color: Colors.black87, blurRadius: 25, offset: Offset(0, 4)),
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
// Metrics Row
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
_buildHUDCol('وقت الوصول (ETA)', '$hourStr:$minStr', const Color(0xFF4ADE80)),
|
||||
Container(width: 1, height: 32, color: Colors.white12),
|
||||
_buildHUDCol('المسافة المتبقية', '${navState.remainingDistanceKm} كم', Colors.white),
|
||||
Container(width: 1, height: 32, color: Colors.white12),
|
||||
_buildHUDCol('الزمن المتبقي', '${navState.remainingDurationMinutes.round()} دقيقة', const Color(0xFF38BDF8)),
|
||||
],
|
||||
),
|
||||
|
||||
const SizedBox(height: 14),
|
||||
|
||||
// Stop Navigation Button
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: ElevatedButton.icon(
|
||||
onPressed: onStopNavigation,
|
||||
icon: const Icon(Icons.close, size: 18),
|
||||
label: const Text(
|
||||
'إنهاء الملاحة الميدانية (Exit Navigation)',
|
||||
style: TextStyle(fontSize: 12.5, fontWeight: FontWeight.bold),
|
||||
),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: const Color(0xFFEF4444),
|
||||
foregroundColor: Colors.white,
|
||||
padding: const EdgeInsets.symmetric(vertical: 12),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildHUDCol(String label, String value, Color color) {
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(label, style: const TextStyle(color: Color(0xFF94A3B8), fontSize: 10)),
|
||||
const SizedBox(height: 3),
|
||||
Text(
|
||||
value,
|
||||
style: TextStyle(color: color, fontSize: 14, fontWeight: FontWeight.w900),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user