mirror of
https://gitlab.com/foxixus/neomovies_mobile.git
synced 2025-10-27 22:38:50 +05:00
02c2abd5fb64dd10f933535769a69714eff1cd98
Problem:
- Gray screens on movie details and downloads
- No error messages shown to debug issues
- API response structure not fully validated
Solution:
1. Enhanced Movie.fromJson() parsing:
- Added detailed logging for each parsing step
- Safe genre parsing: handles [{id: 18, name: Drama}]
- Safe date parsing with null checks
- Safe runtime parsing for both movies and TV shows
- Better media type detection (movie vs tv)
- Comprehensive error logging with stack traces
2. Added detailed API logging:
- getMovieById(): Log request URL, response status, body preview
- getTvShowById(): Log request URL, response status, body preview
- Log API response structure (keys, types, unwrapped data)
- Makes debugging much easier
3. Based on backend API structure:
Backend returns: {"success": true, "data": {...}}
Movie fields from TMDB:
- id (number)
- title or name (string)
- genres: [{"id": int, "name": string}]
- release_date or first_air_date (string)
- vote_average (number)
- runtime or episode_run_time (number/array)
- number_of_seasons, number_of_episodes (int, optional)
Logging examples:
- 'Parsing Movie from JSON: [id, title, genres, ...]'
- 'Parsed genres: [Drama, Thriller, Mystery]'
- 'Successfully parsed movie: Fight Club'
- 'Response status: 200'
- 'Movie data keys: [id, title, overview, ...]'
Changes:
- lib/data/models/movie.dart: Complete rewrite with safe parsing
- lib/data/api/neomovies_api_client.dart: Add detailed logging
Result:
✅ Safer JSON parsing with null checks
✅ Detailed error logging for debugging
✅ Handles all edge cases from API
✅ Easy to debug gray screen issues via logs
Next steps:
Test the app and check Flutter debug console for:
- API request URLs
- Response bodies
- Parsing errors (if any)
- Successful movie loading messages
NeoMovies Mobile 🎬
Мобильное приложение для просмотра фильмов и сериалов, созданное на Flutter.
Возможности
- 📱 Кроссплатформенное приложение (Android/iOS(пока не реализовано))
- 🎥 Просмотр фильмов и сериалов через WebView
- 🌙 Поддержка динамической темы
- 💾 Локальное кэширование данных
- 🔒 Безопасное хранение данных
- 🚀 Быстрая загрузка контента
- 🎨 Современный Material Design интерфейс
Технологии
- Flutter - основной фреймворк
- Provider - управление состоянием
- Hive - локальная база данных
- HTTP - сетевые запросы
- WebView - воспроизведение видео
- Cached Network Image - кэширование изображений
- Google Fonts - красивые шрифты
Установка
- Клонируйте репозиторий:
git clone https://gitlab.com/foxixus/neomovies_mobile.git
cd neomovies_mobile
- Установите зависимости:
flutter pub get
- Создайте файл
.envв корне проекта:
API_URL=your_api_url_here
- Запустите приложение:
flutter run
Сборка
Android APK
flutter build apk --release
iOS
flutter build ios --release
Структура проекта
lib/
├── main.dart # Точка входа
├── models/ # Модели данных
├── services/ # API сервисы
├── providers/ # State management
├── screens/ # Экраны приложения
├── widgets/ # Переиспользуемые виджеты
└── utils/ # Утилиты и константы
Системные требования
- Flutter SDK: 3.8.1+
- Dart: 3.8.1+
- Android: API 21+ (Android 5.0+)
- iOS: iOS 11.0+
Участие в разработке
- Форкните репозиторий
- Создайте ветку для новой функции (
git checkout -b feature/amazing-feature) - Внесите изменения и закоммитьте (
git commit -m 'Add amazing feature') - Отправьте изменения в ветку (
git push origin feature/amazing-feature) - Создайте Pull Request
Лицензия
Этот проект лицензирован под Apache 2.0 License - подробности в файле LICENSE.
Контакты
Если у вас есть вопросы или предложения, создайте issue в этом репозитории.
Description
Languages
Dart
80.2%
Kotlin
9.7%
C++
5.1%
CMake
3.9%
Swift
0.6%
Other
0.5%