How fiazjutt/planetsbrand works
Project type and purpose
• This is a cross-platform Flutter front-end application (“planetbrand”) targeting mobile (Android, iOS), web, desktop (macOS, Linux, Windows).
• It integrates a custom Dart plugin (bank_alfalah_payment-main) for handling payments, uses Firebase, and consumes remote REST APIs for product/catalog data, user accounts, cart, orders, etc.
File structure
• Top-level “android”, “ios”, “web”, “linux”, “macos”, “windows”: platform embedder code, native configuration.
• “lib/”: the core Flutter code:
• components/: reusable widgets (buttons, text fields, loaders, sheets)
• pages/: feature modules (landing, auth, home, category, brands, cart, account, search, product_details, favorites, festivals, shop, other) each with UI screens, controllers, models
• firebase_options.dart: Firebase initialization
• main.dart: application entry point
• bank_alfalah_payment-main/: a packaged plugin with src/models, src/services (hash, payment), src/ui (payment screen), src/utils
• Configuration: pubspec.yaml, analysis_options.yaml, firebase.json, platform build files
Relationships and interactions
• User taps UI widget → Controller method
• Controller invokes Service (e.g., ApiHelper, PaymentService)
• Service → REST API / Payment gateway / Firebase → returns Model
• Controller updates state → UI rebuilt with new Model data
• Local storage used for caching tokens, preferences
• Plugin interacts with WebView or native SDKs for payments
Architectural patterns & design principles
• MVVM/DC (Widgets = View, Controllers = ViewModel/Presenter, Models = Data)
• Layered architecture: clear separation of concerns
• Modular structure: pages organized by feature, reusable components library
• Plugin/Package isolation: bank_alfalah_payment is a self-contained module