This core
package serves as the foundational shared library for the Flutter News App Full Source Code Toolkit. It defines the common language and data structures—including models for news content, user data, and remote configurations—that ensure consistency and accelerate development across the Flutter mobile app, web dashboard, and Dart Frog backend API.
This package provides the critical building blocks for a professional news application ecosystem.
🧱 Unified Data Models
Headline
,Topic
,Source
,Country
,Language
: Comprehensive models for all core news content, ensuring consistent representation across the entire toolkit.FeedItem
: An abstract base class for all items that can appear in a mixed content feed, supporting diverse content types like headlines, ads, and suggested content.
User
,AppUserRole
,DashboardUserRole
,Permission
: Robust models for user profiles, roles, and permissions, enabling secure and personalized experiences.UserContentPreferences
,UserAppSettings
: Detailed models for storing user-specific content preferences (e.g., followed topics, saved headlines) and application settings (e.g., theme, language).
RemoteConfig
: A central container for all dynamic application settings, fetched from a remote source. This includes:AdConfig
: Master configuration for all advertising, now featuring highly flexible, role-based control over ad visibility and frequency for feed, article, and interstitial ads. This allows for granular control over monetization strategies per user segment.UserPreferenceConfig
: Defines user preference limits (e.g., max followed items, saved headlines) tiered by user role.AppStatus
: Manages application-wide status, including maintenance mode and force update directives.FeedDecoratorConfig
: Configures dynamic in-feed elements like calls-to-action and content collections, with role-based visibility.
DashboardSummary
: Provides a model for aggregated statistics, useful for administrative dashboards.
SortOption
,PaginationOptions
: Models for building flexible, server-side queries with sorting and pagination capabilities.PaginatedResponse
,SuccessApiResponse
: Standardized response wrappers for consistent API communication.HttpException
Hierarchy: A comprehensive set of custom exceptions for predictable and standardized error handling across all layers of the application.
💡 Your Advantage: You get a meticulously designed, production-quality data layer that forms the backbone of a scalable news platform. This package eliminates the need to define core data structures from scratch, saving months of development time and ensuring architectural consistency.
🧪 Sample Data & Fixtures
To further accelerate development and provide immediate demonstration capabilities, core
includes a set of pre-defined, in-memory fixture data for core models like Headline
, Topic
, Source
, Country
, and RemoteConfig
. These fixtures are directly embedded as Dart constants, enabling:
- ⚡ Instant Setup: Quickly initialize in-memory data stores for testing or local development without needing a backend.
- 🧪 Reliable Testing: Use consistent, realistic data for unit and integration tests.
- 🚀 Rapid Prototyping: Jumpstart UI development and feature implementation with readily available sample content.
💡 Your Advantage: Leverage ready-to-use sample data for rapid prototyping, reliable testing, and instant setup of development environments, significantly accelerating your workflow.
This core
package is an integral part of the Flutter News App Full Source Code Toolkit. For comprehensive details regarding licensing, including trial and commercial options for the entire toolkit, please refer to the main toolkit organization page.