Aplikasi CMS Mobile menggunakan Flutter dengan arsitektur MVVM yang terkoneksi dengan Laravel API.
- ✅ List Posts dengan filter status (published/draft)
- ✅ List Categories dengan grid view
- ✅ Detail Post lengkap
- ✅ Filter Posts by Category
- ✅ Pull to refresh
- ✅ Infinite scroll / Load more
- ✅ State management dengan Provider
- ✅ Routing system dengan named routes
- ✅ Reusable widgets & animations
- ✅ AutomaticKeepAlive untuk tab persistence
lib/
├── main.dart # Entry point
├── core/ # Core functionality
│ ├── config/ # API configuration
│ └── routes/ # Routing & navigation
├── data/ # Data layer
│ ├── models/ # Data models (Category, Post, User, Pagination)
│ ├── services/ # API services
│ └── viewmodels/ # State management (Business logic)
└── ui/ # UI layer
├── pages/ # Screens/Pages
├── widgets/ # Reusable components
└── animations/ # Animation widgets
- Flutter SDK 3.8.1 atau lebih baru
- Dart 3.0+
- Laravel API backend (endpoint:
/api/v1)
- Clone repository
git clone <repository-url>
cd folio_mobile- Install dependencies
flutter pub get- Konfigurasi API URL
Edit file lib/core/config/api_config.dart:
class ApiConfig {
// Ganti dengan IP address komputer/server Anda
static const String baseUrl = 'http://192.168.0.3:8000/api/v1';
static const String healthUrl = 'http://192.168.0.3:8000/api/health';
}Tips mengatur URL:
- Android Emulator: Gunakan IP komputer Anda (cek dengan
ipconfigdi Windows) - iOS Simulator: Gunakan IP komputer Anda
- Real Device: Pastikan device dan komputer di WiFi yang sama, gunakan IP komputer
- Run aplikasi
flutter rundependencies:
flutter:
sdk: flutter
http: ^1.1.0 # HTTP client untuk API calls
provider: ^6.1.1 # State management
intl: ^0.19.0 # Date formattingAplikasi ini menggunakan MVVM (Model-View-ViewModel) pattern:
- Model (
data/models/): Data structures & serialization - View (
ui/pages/,ui/widgets/): UI components - ViewModel (
data/viewmodels/): Business logic & state management - Service (
data/services/): Data source (API calls)
Menggunakan Provider dengan ChangeNotifier:
PostViewModel- Mengelola state postsCategoryViewModel- Mengelola state categories
Named routes dengan helper methods di AppRoutes:
AppRoutes.navigateToPostDetail(context, post);
AppRoutes.navigateToCategoryPosts(context, category);- HomePage - Bottom navigation dengan 2 tab (Posts & Categories)
- PostsPage - List posts dengan filter status dan infinite scroll
- CategoriesPage - Grid categories dengan post count
- CategoryPostsPage - Posts filtered by category
- PostDetailPage - Detail lengkap post dengan meta information
// From main.dart
import 'data/viewmodels/post_viewmodel.dart';
import 'core/routes/app_routes.dart';
// From pages (ui/pages/)
import '../../data/viewmodels/post_viewmodel.dart';
import '../widgets/post_list_item.dart';
// From widgets (ui/widgets/)
import '../../data/models/post.dart';- Buat file di
lib/ui/pages/ - Tambahkan route di
lib/core/routes/app_routes.dart - Tambahkan navigation helper method
- Buat file di
lib/ui/widgets/ - Import di halaman yang membutuhkan
# Run tests
flutter test
# Run with coverage
flutter test --coverage# Build APK (Android)
flutter build apk --release
# Build App Bundle (Android)
flutter build appbundle --release
# Build IPA (iOS)
flutter build ipa --release- Pastikan device dan komputer di network yang sama
- Cek IP address dengan
ipconfig(Windows) atauifconfig(Mac/Linux) - Pastikan firewall tidak memblok koneksi
- Test API dengan browser di device:
http://IP_ADDRESS:8000/api/health
- Sudah diatasi dengan AutomaticKeepAliveClientMixin
- Pastikan
super.build(context)ada di build method - Gunakan conditional loading:
if (categories.isEmpty && !isLoading)
- Gunakan
ExpandedatauFlexibleuntuk flexible sizing - Wrap text dengan
Flexibledan setoverflow: TextOverflow.ellipsis - Set
mainAxisSize: MainAxisSize.minuntuk Column/Row dalam constraint
This project is licensed under the MIT License.
Your Name / Team Name