The essential shared Dart package providing the Core Data Models for the Flutter News App - Full Source Code Toolkit. It ensures data consistency and accelerates development across the Flutter mobile app, web dashboard, and Dart Frog backend API.
Think of it as the common language 🗣️ that all parts of your news application will speak!
- 🧱 Unified Data Structure: Guarantees that
Headline
,Source
,User
, and configuration data are handled identically across the entire Flutter News App - Full Source Code Toolkit. - 🚀 Rapid Development: Start building features faster with pre-defined, robust models for common news application needs.
- 🔗 Seamless Integration: Enables the Flutter mobile app, web dashboard, and Dart Frog API to work together flawlessly using a shared language.
- 🎯 Consistency by Design: Reduces errors and simplifies maintenance by providing a single source of truth for all core data definitions.
- 🛡️ Standardized Error Handling: Includes a comprehensive hierarchy of
HttpException
subtypes for predictable error management across all layers. - 🌟 Foundation for Rich Features: Provides models for user personalization (
UserContentPreferences
,UserAppSettings
), dynamic feed items (e.g.,Ad
,CallToActionItem
,ContentCollectionItem
), remote configuration (RemoteConfig
), and standardized API responses.
This package includes well-defined Dart classes for:
- News & Content Entities:
Headline
,Topic
,Source
,Country
,Language
- Feed System:
FeedItem
(the abstract base class for all feed content) and its concrete subtypes likeHeadline
,Ad
,CallToActionItem
, andContentCollectionItem
. - User Data:
User
,AppUserRole
,DashboardUserRole
,Permission
,UserContentPreferences
,UserAppSettings
- Application Configuration:
RemoteConfig
(containingAdConfig
,UserPreferenceConfig
,AppStatus
, andFeedDecoratorConfig
) - Dashboard:
DashboardSummary
- Querying & Pagination:
SortOption
andPaginationOptions
to build flexible, server-side queries. - API Communication:
PaginatedResponse
,SuccessApiResponse
, and a comprehensiveHttpException
hierarchy for standardized responses and error handling.
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.
This package is source-available and licensed under the PolyForm Free Trial 1.0.0. Please review the terms before use.
For commercial licensing options that grant the right to build and distribute unlimited applications, please visit the main Flutter News App - Full Source Code Toolkit organization.
To integrate core
into a component of the Flutter News App - Full Source Code Toolkit :
-
Add
core
as a dependency in yourpubspec.yaml
file:dependencies: core: git: url: https://github.com/flutter-news-app-full-source-code/core.git # You might want to pin to a specific ref/tag in a real project: # ref: main
-
Run
dart pub get
(orflutter pub get
for Flutter projects). -
Import
package:core/core.dart
to access all shared models and utilities.import 'package:core/core.dart';