diff --git a/android/app/proguard-rules.pro b/android/app/proguard-rules.pro deleted file mode 100644 index 86e922f..0000000 --- a/android/app/proguard-rules.pro +++ /dev/null @@ -1,28 +0,0 @@ -# TensorFlow Lite --keep class org.tensorflow.** { *; } --dontwarn org.tensorflow.** - -# TFLite GPU Delegate --keep class org.tensorflow.lite.gpu.** { *; } --dontwarn org.tensorflow.lite.gpu.** - -# TFLite Support Libraries --keep class org.tensorflow.lite.support.** { *; } --dontwarn org.tensorflow.lite.support.** - -# Prevent R8 stripping --keep class com.google.** { *; } --dontwarn com.google.** - -# Keep your YOLO model loader class if needed --keep class your.package.name.YOLODetect { *; } - -# Flutter Local Notifications --keep class com.dexterous.** { *; } --dontwarn com.dexterous.** - -# Timezone --keep class com.jakewharton.threetenabp.** { *; } --dontwarn com.jakewharton.threetenabp.** --keep class org.threeten.** { *; } --dontwarn org.threeten.** diff --git a/assets/google_logo.png b/assets/google_logo.png deleted file mode 100644 index 16302aa..0000000 Binary files a/assets/google_logo.png and /dev/null differ diff --git a/assets/logo.png b/assets/logo.png deleted file mode 100644 index da243c2..0000000 Binary files a/assets/logo.png and /dev/null differ diff --git a/assets/logo.svg b/assets/logo.svg deleted file mode 100644 index 2c743eb..0000000 --- a/assets/logo.svg +++ /dev/null @@ -1,176 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/assets/target.svg b/assets/target.svg deleted file mode 100644 index 4f10830..0000000 --- a/assets/target.svg +++ /dev/null @@ -1,305 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/screens/camera_selection_dialog.dart b/lib/screens/camera_selection_dialog.dart deleted file mode 100644 index 9c24e1c..0000000 --- a/lib/screens/camera_selection_dialog.dart +++ /dev/null @@ -1,137 +0,0 @@ -import 'package:flutter/material.dart'; -import '../utils/translations.dart'; - -class CameraSelectionDialog extends StatefulWidget { - final List> availableCameras; - final String selectedLanguage; - - const CameraSelectionDialog({ - super.key, - required this.availableCameras, - required this.selectedLanguage, - }); - - @override - State createState() => _CameraSelectionDialogState(); -} - -class _CameraSelectionDialogState extends State { - late List _selectedCameras; - - @override - void initState() { - super.initState(); - _selectedCameras = List.generate(widget.availableCameras.length, (_) => false); - } - - String _t(String key) { - return AppTranslations.translate(key, widget.selectedLanguage); - } - - @override - Widget build(BuildContext context) { - return AlertDialog( - backgroundColor: Colors.grey[900], - title: Text( - _t('Select Cameras to Spectate'), - style: const TextStyle( - color: Colors.white, - fontSize: 18, - fontWeight: FontWeight.w600, - ), - ), - content: SizedBox( - width: double.maxFinite, - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Text( - _t('Choose 1-6 cameras'), - style: TextStyle( - color: Colors.grey[400], - fontSize: 14, - ), - ), - const SizedBox(height: 16), - Flexible( - child: ListView.builder( - shrinkWrap: true, - itemCount: widget.availableCameras.length, - itemBuilder: (context, index) { - final camera = widget.availableCameras[index]; - final cameraIndex = camera['index'] as int; - final cameraIp = camera['ip'] as String; - - return CheckboxListTile( - title: Text( - "${_t('Camera')} $cameraIndex", - style: const TextStyle( - color: Colors.white, - fontSize: 16, - fontWeight: FontWeight.w500, - ), - ), - subtitle: Text( - cameraIp, - style: TextStyle( - color: Colors.grey[400], - fontSize: 12, - ), - ), - value: _selectedCameras[index], - onChanged: (value) { - setState(() { - _selectedCameras[index] = value ?? false; - }); - }, - activeColor: Colors.grey[800], - checkColor: Colors.white, - tileColor: Colors.grey[850], - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(8), - ), - contentPadding: const EdgeInsets.symmetric( - horizontal: 12, - vertical: 4, - ), - ); - }, - ), - ), - ], - ), - ), - actions: [ - TextButton( - onPressed: () => Navigator.pop(context), - child: Text( - _t('Cancel'), - style: const TextStyle(color: Colors.grey), - ), - ), - TextButton( - onPressed: _selectedCameras.contains(true) - ? () { - final selectedCameras = >[]; - for (int i = 0; i < _selectedCameras.length; i++) { - if (_selectedCameras[i]) { - selectedCameras.add(widget.availableCameras[i]); - } - } - Navigator.pop(context, selectedCameras); - } - : null, - child: Text( - _t('View Cameras'), - style: TextStyle( - color: _selectedCameras.contains(true) - ? Colors.white - : Colors.grey[600], - fontWeight: FontWeight.w600, - ), - ), - ), - ], - ); - } -} diff --git a/lib/screens/multi_camera_screen.dart b/lib/screens/multi_camera_screen.dart deleted file mode 100644 index eeecbfb..0000000 --- a/lib/screens/multi_camera_screen.dart +++ /dev/null @@ -1,248 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_mjpeg/flutter_mjpeg.dart'; -import '../utils/translations.dart'; - -class MultiCameraScreen extends StatefulWidget { - final List> cameras; - final String selectedLanguage; - - const MultiCameraScreen({ - super.key, - required this.cameras, - required this.selectedLanguage, - }); - - @override - State createState() => _MultiCameraScreenState(); -} - -class _MultiCameraScreenState extends State { - int? _fullscreenIndex; // null = grid view, index = fullscreen camera - - String _t(String key) { - return AppTranslations.translate(key, widget.selectedLanguage); - } - - // Calculate grid columns based on camera count - int get _crossAxisCount { - final count = widget.cameras.length; - if (count == 1) return 1; - if (count <= 4) return 2; - return 3; // 5-6 cameras - } - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: Text( - _fullscreenIndex == null - ? _t('Multi-Camera View') - : "${_t('Camera')} ${widget.cameras[_fullscreenIndex!]['index']}", - ), - backgroundColor: Colors.grey[900], - foregroundColor: Colors.white, - leading: IconButton( - icon: const Icon(Icons.arrow_back, color: Colors.white), - onPressed: () { - if (_fullscreenIndex != null) { - setState(() { - _fullscreenIndex = null; // Exit fullscreen first - }); - } else { - Navigator.pop(context); // Exit screen - } - }, - ), - ), - backgroundColor: Colors.black, - body: _fullscreenIndex == null - ? _buildGridView() - : _buildFullscreenView(_fullscreenIndex!), - ); - } - - Widget _buildGridView() { - return GridView.builder( - padding: const EdgeInsets.all(8), - itemCount: widget.cameras.length, - gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: _crossAxisCount, - mainAxisSpacing: 8, - crossAxisSpacing: 8, - childAspectRatio: 4 / 3, // 4:3 aspect ratio for camera feeds - ), - itemBuilder: (context, index) { - return _buildCameraCell(index); - }, - ); - } - - Widget _buildCameraCell(int index) { - final camera = widget.cameras[index]; - final cameraIndex = camera['index'] as int; - final cameraIp = camera['ip'] as String; - - final streamUrl = cameraIp.startsWith(RegExp(r"https?://")) - ? cameraIp - : "http://$cameraIp"; - - return GestureDetector( - onTap: () { - setState(() { - _fullscreenIndex = index; // Enter fullscreen - }); - }, - child: Container( - decoration: BoxDecoration( - color: Colors.black, - borderRadius: BorderRadius.circular(8), - border: Border.all(color: Colors.grey[700]!, width: 1), - ), - child: ClipRRect( - borderRadius: BorderRadius.circular(8), - child: Stack( - children: [ - // MJPEG Stream - Mjpeg( - stream: streamUrl, - isLive: true, - fit: BoxFit.contain, - error: (context, error, stackTrace) { - return _buildErrorWidget(cameraIndex); - }, - ), - // Camera label overlay - Positioned( - top: 8, - left: 8, - child: Container( - padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), - decoration: BoxDecoration( - color: Colors.black.withValues(alpha: 0.6), - borderRadius: BorderRadius.circular(4), - ), - child: Text( - "${_t('Camera')} $cameraIndex", - style: const TextStyle( - color: Colors.white, - fontSize: 12, - fontWeight: FontWeight.w600, - ), - ), - ), - ), - ], - ), - ), - ), - ); - } - - Widget _buildFullscreenView(int index) { - final camera = widget.cameras[index]; - final cameraIndex = camera['index'] as int; - final cameraIp = camera['ip'] as String; - - final streamUrl = cameraIp.startsWith(RegExp(r"https?://")) - ? cameraIp - : "http://$cameraIp"; - - return GestureDetector( - onTap: () { - setState(() { - _fullscreenIndex = null; // Exit fullscreen, return to grid - }); - }, - child: Container( - color: Colors.black, - child: Stack( - children: [ - Center( - child: Mjpeg( - stream: streamUrl, - isLive: true, - fit: BoxFit.contain, - error: (context, error, stackTrace) { - return _buildErrorWidget(cameraIndex); - }, - ), - ), - // Back indicator overlay - Positioned( - bottom: 16, - left: 0, - right: 0, - child: Center( - child: Container( - padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), - decoration: BoxDecoration( - color: Colors.black.withValues(alpha: 0.6), - borderRadius: BorderRadius.circular(20), - ), - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - const Icon(Icons.touch_app, color: Colors.white, size: 16), - const SizedBox(width: 8), - Text( - _t('Tap to return to grid'), - style: - const TextStyle(color: Colors.white, fontSize: 14), - ), - ], - ), - ), - ), - ), - // Camera label - Positioned( - top: 16, - left: 16, - child: Container( - padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6), - decoration: BoxDecoration( - color: Colors.black.withValues(alpha: 0.6), - borderRadius: BorderRadius.circular(6), - ), - child: Text( - "${_t('Camera')} $cameraIndex", - style: const TextStyle( - color: Colors.white, - fontSize: 16, - fontWeight: FontWeight.w600, - ), - ), - ), - ), - ], - ), - ), - ); - } - - Widget _buildErrorWidget(int cameraIndex) { - return Container( - color: Colors.black, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Icon(Icons.videocam_off, color: Colors.red, size: 32), - const SizedBox(height: 4), - Flexible( - child: Text( - "${_t('Camera')} $cameraIndex\n${_t('Stream unavailable')}", - style: const TextStyle( - color: Colors.white70, - fontSize: 11, - ), - textAlign: TextAlign.center, - maxLines: 2, - overflow: TextOverflow.ellipsis, - ), - ), - ], - ), - ); - } -} diff --git a/lib/services/shared_prefs_service.dart b/lib/services/shared_prefs_service.dart deleted file mode 100644 index c3a0d53..0000000 --- a/lib/services/shared_prefs_service.dart +++ /dev/null @@ -1,15 +0,0 @@ -import 'package:shared_preferences/shared_preferences.dart'; - -class SharedPrefsService { - static Future saveCameraIPs(List cameraIPs) async { - SharedPreferences prefs = await SharedPreferences.getInstance(); - for (int i = 0; i < 6; i++) { - prefs.setString('camera_$i', cameraIPs[i]); - } - } - - static Future> loadCameraIPs() async { - SharedPreferences prefs = await SharedPreferences.getInstance(); - return List.generate(6, (index) => prefs.getString('camera_$index') ?? ''); - } -} diff --git a/test/widget_test.dart b/test/widget_test.dart deleted file mode 100644 index 1109a73..0000000 --- a/test/widget_test.dart +++ /dev/null @@ -1,30 +0,0 @@ -// This is a basic Flutter widget test. -// -// To perform an interaction with a widget in your test, use the WidgetTester -// utility in the flutter_test package. For example, you can send tap and scroll -// gestures. You can also use WidgetTester to find child widgets in the widget -// tree, read text, and verify that the values of widget properties are correct. - -import 'package:flutter/material.dart'; -import 'package:flutter_test/flutter_test.dart'; - -import 'package:test1/main.dart'; - -void main() { - testWidgets('Counter increments smoke test', (WidgetTester tester) async { - // Build our app and trigger a frame. - await tester.pumpWidget(const MyApp()); - - // Verify that our counter starts at 0. - expect(find.text('0'), findsOneWidget); - expect(find.text('1'), findsNothing); - - // Tap the '+' icon and trigger a frame. - await tester.tap(find.byIcon(Icons.add)); - await tester.pump(); - - // Verify that our counter has incremented. - expect(find.text('0'), findsNothing); - expect(find.text('1'), findsOneWidget); - }); -}