How arkefallen/foodie works
Project type and purpose
• This is a cross-platform Flutter mobile/web/desktop application (“Foodie”) for browsing restaurants via the Dicoding Restaurant API, viewing details, searching, writing reviews, managing favorites, toggling theme, and scheduling a daily reminder notification.
File structure
• Top-level folders:
• android, ios, linux, macos, windows, web – platform-specific shell and native integration
• lib – core Dart/Flutter code organized into data, provider, screens, theme, and util
• integration_test & test – automated end-to-end and unit/widget tests
• lib/data:
• datasource – services (network API, local DB, notification & preferences, background worker)
• model – DTOs mapping JSON from the restaurant API
• lib/provider: ChangeNotifier classes implementing state management for lists, details, search, favorites, reminders, theme, reviews
• lib/screens: UI pages and states for each use case, plus reusable widgets
• Configuration/build scripts: pubspec.yaml, Gradle/CMake files, XCode project files
README
• Confirms use of Dicoding Restaurant API, features (list, detail, search, review, notifications, theme, favorites), and how to run the Flutter app.
a. Main components
• Flutter Application (UI Layer)
– Screens & Widgets
– State Management (Providers)
• Domain/Data Layer
– Models (restaurant, review, preferences)
– Repositories / Services (RestaurantService, LocalDatabaseService, NotificationService, ReminderPreferencesService, ThemePreferencesService, WorkerService)
• External Services
– Dicoding Restaurant REST API
– Local SQLite/SharedPreferences or platform storage
– Platform Notification/Background Scheduler (Android WorkManager, iOS notifications, etc.)
b. Relationships & interactions
1. User taps UI → Provider method → calls RestaurantService (over HTTP) or LocalDatabaseService
2. RestaurantService fetches JSON → Model layer → Provider updates state → UI redraw
3. Review flow: UI → AddReviewProvider → RestaurantService.submitReview → API
4. Favorite flow: Provider updates LocalDatabaseService → persists favorites → Provider emits new state → UI updates
5. Daily reminder: WorkerService (platform scheduler) triggers NotificationService using stored ReminderPreferences → shows local notification
6. Theme toggle: UI Provider toggles ThemePreferencesService → writes prefs → Root widget rebuilds in new ThemeData
c. Architectural patterns
• Layered architecture (UI → State/Provider → Data/Service → External)
• MVVM-like separation: Views (Screens) observe ViewModels (Providers)
• Repository/Service pattern for data sources
d. Key technologies/frameworks
• Flutter/Dart
• Provider package for state management
• HTTP package (or Dio) for REST calls
• SharedPreferences/SQLite for local persistence
• Platform-specific notification and background scheduling APIs via Flutter plugins