A production-focused Flutter starter app that converts any WordPress site into a modern mobile news/content app for Android and iOS.
This project uses the WordPress REST API, Material 3 UI, category-based browsing, search, comments, sharing, related posts, offline cache mode, and reusable integration points for notifications, ads, and deep links.
SEO keywords: WordPress to Flutter, Flutter WordPress app, WordPress REST API mobile app, Android iOS WordPress app template, Flutter news app template.
- One codebase for Android and iOS
- WordPress-connected out of the box
- Premium-style Material 3 responsive UI
- Config-driven setup through a single root config file
- Clear extension points for production integrations
- WordPress API authentication using Application Password
- Latest posts feed with infinite scroll
- Featured top 3 posts slider
- Categories list and category-based filtering
- Search posts
- Post detail page with:
- Cover image/video thumbnail support
- Embedded video rendering from post content
- Metadata (date, author, category)
- Share post link
- WordPress comments:
- Load existing comments
- Submit new comments
- Related posts from the same category
- Theme modes: System / Light / Dark
- Offline cache mode + clear cached content
- Settings page with app preferences and legal links
- Integration hook points for OneSignal, AdMob, Dynamic Links
- Flutter + Material 3
- Provider for state management
httpfor API requestsshared_preferencesfor settings/cache persistenceflutter_secure_storagefor commenter identity fields
- Flutter SDK installed
- Android Studio / Xcode set up for Flutter
- A WordPress site with REST API enabled
- A WordPress user with an Application Password
flutter pub getCopy the example file and edit values:
cp app_config.example.json app_config.jsonThen update app_config.json.
Do not commit real production credentials to source control.
flutter runThe app reads configuration globally from app_config.json in the project root.
app_name: App display name (title + splash label)wp_domain: WordPress base URL used for REST API (example:https://dash.example.com)wp_user: WordPress username for Application Password authwp_app_pass: WordPress Application Passwordapp_icon_path: App icon/brand fallback asset path or URLapp_logo_path: Logo path or URL used in branded splash screenoneSignalAppId: OneSignal App ID (optional)admobAndroidAppId: AdMob Android App ID (optional)admobIosAppId: AdMob iOS App ID (optional)
{
"app_name": "Web2Flutter",
"wp_domain": "https://dashboard.your-site.com",
"wp_user": "your_wp_username",
"wp_app_pass": "xxxx xxxx xxxx xxxx xxxx xxxx",
"app_icon_path": "assets/branding/app_icon.png",
"app_logo_path": "assets/branding/app_logo.png",
"oneSignalAppId": "your_onesignal_app_id",
"admobAndroidAppId": "ca-app-pub-xxxxxxxxxxxxxxxx~xxxxxxxxxx",
"admobIosAppId": "ca-app-pub-xxxxxxxxxxxxxxxx~xxxxxxxxxx"
}For reliable API access:
- Ensure REST API is accessible:
https://your-domain.com/wp-json/
- Create an Application Password in WordPress user profile
- Use a user role with permission to read posts/categories and submit comments
- If media does not load, verify:
- WordPress/media URLs are publicly accessible
- No firewall/security plugin is blocking API/media requests
- Correct protocol/domain (
https://...) inwp_domain
flutter runflutter analyzeflutter testflutter build apk --debugflutter run -d iosThese are intentionally left as clean extension points:
- Notifications (OneSignal):
lib/src/services/notification_service.dart - Ads (AdMob):
lib/src/services/ad_service.dart - Dynamic links:
lib/src/services/deep_link_service.dart
Add production SDK setup in these files without changing app-level feature flow.
This template supports direct WordPress auth from the app for quick setup and demos.
For real production environments, do not rely on shipping raw WordPress credentials in a client app. They can be extracted from a built binary.
Recommended approach:
- Mobile app calls your own backend API
- Backend calls WordPress API using server-side credentials
- Backend returns only required data to the app
If credentials are exposed, rotate wp_app_pass immediately.
Use this architecture for scale and security:
- Edge/CDN Layer
- WAF, TLS, bot filtering, coarse rate limiting
- API Gateway Layer
- Single entry domain (
api.yourdomain.com) - Auth, quotas, CORS allowlist, request limits
- Proxy Service Layer
- Stateless API instances
- Strict allowlist of upstream WordPress endpoints
- Input validation and response shaping
- Caching Layer
- Redis/in-memory cache for hot routes (
latest,featured,categories,search) - TTL-based invalidation for freshness
- Observability & Operations
- Structured logs, metrics, tracing, alerts
- Retries, timeouts, circuit breakers
- Stable Mobile Contract
- Versioned endpoints like
/v1/posts/latest,/v1/posts/search,/v1/comments - Keep mobile response schema stable regardless of WordPress internals
If you see Kotlin/plugin errors (for example unresolved classes from share_plus or package_info_plus), keep these compatible versions:
share_plus: ^10.1.4package_info_plus: ^8.3.1
Then run:
flutter clean
flutter pub get
flutter build apk --debugadb kill-server
adb start-server
flutter runThis repository is configured for Android and iOS. If you also want Web support, run:
flutter create .lib/src/config/app configuration loadinglib/src/services/API, cache, and integration serviceslib/src/repositories/data repository layerlib/src/viewmodels/state/view modelslib/src/screens/screens and app shelllib/src/widgets/reusable UI components
- Fully developed by Chandima Galahitiyawa
- Funded by Turn.Global for the community
Community contributions are welcome.
- Fork the repository
- Create a feature branch
- Commit your changes
- Open a pull request with clear test notes
This project is 100% free and open-source under the GNU General Public License v3.0 (GPL-3.0).
Anyone can:
- Use it for personal or commercial projects
- Modify the source code
- Develop and distribute their own versions
No license fee, royalty, or paid permission is required.
GPL note for redistribution:
- Keep the same GPL-3.0 license
- Keep copyright/license notices
- Provide source code for distributed modified builds
This software is provided without warranty, as defined by GPL-3.0.
See LICENSE for the full license text.
