mirror of
https://gitlab.com/foxixus/neomovies_mobile.git
synced 2025-10-27 17:18:51 +05:00
6b59750621c1659acd4143add6f0cf8e72562a90
Problem: - Gray screens without error messages made debugging impossible - Users couldn't see what went wrong - Developers couldn't debug issues without full stack traces Solution: 1. Created ErrorDisplay widget (lib/presentation/widgets/error_display.dart): ✅ Shows detailed error message with copy button ✅ Expandable stack trace section with syntax highlighting ✅ Retry button for failed operations ✅ Debug tips for troubleshooting ✅ Beautiful UI with icons, colors, and proper styling ✅ Fully selectable text for easy copying Features: - 🔴 Red error card with full error message - 🟠 Orange expandable stack trace panel - 🔵 Blue tips panel with debugging suggestions - 📋 Copy buttons for error and stack trace - 🔄 Retry button to attempt operation again - 📱 Responsive scrolling for long errors 2. Updated MovieDetailProvider: ✅ Added _stackTrace field to store full stack trace ✅ Save stack trace in catch block: catch (e, stackTrace) ✅ Expose via getter: String? get stackTrace 3. Updated DownloadsProvider: ✅ Added _stackTrace field ✅ Updated _setError() to accept optional stackTrace parameter ✅ Save stack trace in refreshDownloads() catch block ✅ Print error and stack trace to console 4. Updated MovieDetailScreen: ✅ Replaced simple Text('Error: ...') with ErrorDisplay widget ✅ Shows 'Ошибка загрузки фильма/сериала' title ✅ Pass error, stackTrace, and onRetry callback ✅ Retry attempts to reload media 5. Updated DownloadsScreen: ✅ Replaced custom error UI with ErrorDisplay widget ✅ Shows 'Ошибка загрузки торрентов' title ✅ Pass error, stackTrace, and onRetry callback ✅ Retry attempts to refresh downloads Error Display Features: ---------------------------- 📋 Сообщение об ошибке: [Red card with full error text] [Copy button] 🐛 Stack Trace (для разработчиков): [Expandable orange section] [Black terminal-style with green text] [Copy stack trace button] 💡 Советы по отладке: • Скопируйте ошибку и отправьте разработчику • Проверьте соединение с интернетом • Проверьте логи Flutter в консоли • Попробуйте перезапустить приложение 🔄 [Попробовать снова] button Example Error Display: ---------------------- ┌────────────────────────────────────┐ │ ⚠️ Произошла ошибка │ │ │ │ 📋 Сообщение об ошибке: │ │ ┌──────────────────────────────┐ │ │ │ Exception: Failed to load │ │ │ │ movie: 404 - Not Found │ │ │ │ [Копировать ошибку] │ │ │ └──────────────────────────────┘ │ │ │ │ 🐛 Stack Trace ▶ │ │ │ │ 💡 Советы по отладке: │ │ ┌──────────────────────────────┐ │ │ │ • Скопируйте ошибку... │ │ │ │ • Проверьте соединение... │ │ │ └──────────────────────────────┘ │ │ │ │ [🔄 Попробовать снова] │ └────────────────────────────────────┘ Changes: - lib/presentation/widgets/error_display.dart (NEW): 254 lines - lib/presentation/providers/movie_detail_provider.dart: +4 lines - lib/presentation/providers/downloads_provider.dart: +6 lines - lib/presentation/screens/movie_detail/movie_detail_screen.dart: +11/-2 lines - lib/presentation/screens/downloads/downloads_screen.dart: +4/-27 lines Result: ✅ No more gray screens without explanation! ✅ Full error messages visible on screen ✅ Stack traces available for developers ✅ Copy button for easy error reporting ✅ Retry button for quick recovery ✅ Beautiful, user-friendly error UI ✅ Much easier debugging process Testing: -------- 1. Open app and tap on a movie card 2. If error occurs, you'll see: - Full error message in red card - Stack trace in expandable section - Copy buttons for error and stack trace - Retry button to try again 3. Same for Downloads screen Now debugging is 10x easier! 🎉
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%