blueprint_flutter_core library
Shared foundation for Blueprint Flutter apps (networking, auth, theme, Fx widgets).
Bootstrap — config + root widget:
import 'package:blueprint_flutter_core/blueprint_flutter_core.dart';
void main() {
WidgetsFlutterBinding.ensureInitialized();
runApp(BlueprintFlutterCore(config: MyAppConfig(), child: const MyApp()));
}
Grouped imports (prefer these over deep src/ paths):
| Library | Use for |
|---|---|
blueprint_flutter_core.dart |
Config, environment, endpoints, errors, pagination, JWT, logger, FxControllerMixin, BlueprintFlutterCore |
blueprint_theme.dart |
Fx theme tokens, ThemeController |
blueprint_widgets.dart |
Fx widgets, ScreenUtil, validators, formatters |
blueprint_network.dart |
Dio client, services, Firebase client, interceptors |
blueprint_auth.dart |
Auth flows, AuthController, email/phone UI |
blueprint_notifications.dart |
Notifications |
blueprint_profile.dart |
Profile |
Classes
- ApiErrorResponse
- Maps the server's standard error JSON shape: { "statusCode": 401, "message": "...", "error": "Unauthorized", "requestId": "uuid" }
- AuthGuard
- Handles auth-based route redirection.
- BlueprintFlutterCore
-
Root widget that wires
ProviderScopewith fxConfigProvider for the foundation layer. - FileRef
- A reference to a remote file (image, document, etc.).
- FxApiEndpoints
-
Foundation-provided endpoint paths.
Extend this in
app/config/to add app-specific endpoints. Override any getter to change a default path. - FxConfig
- Blueprint contract for app-level configuration.
- FxConfigProvider
- Override in main.dart with your FxConfig implementation.
- FxCore
- FxLogger
- Application-wide structured logger.
- FxRouteObserver
-
Route observer that logs navigation events via FxLogger.
Pass to GoRouter's
observerslist. - FxRouterNotifier
-
Bridges Riverpod state changes to GoRouter's
refreshListenable. Use this in your app's router provider to react to auth state changes. -
FxState<
T extends FxState< T> > - JwtHelper
- Decodes a JWT access token to expose user claims.
-
PaginatedResponse<
T> - Generic wrapper for all paginated API responses.
- PaginationMeta
- Pagination metadata returned by every list endpoint.
- RemoteMessage
- A class representing a message sent from Firebase Cloud Messaging.
Enums
- Environment
- Defines the deployment environments for the app.
Mixins
Extensions
- ApiErrorResponsePatterns on ApiErrorResponse
- Adds pattern-matching-related methods to ApiErrorResponse.
- FileRefPatterns on FileRef
- Adds pattern-matching-related methods to FileRef.
- PaginationMetaPatterns on PaginationMeta
- Adds pattern-matching-related methods to PaginationMeta.
Constants
- defaultPaginationMeta → const PaginationMeta
Properties
-
defaultPaginationMetaJson
↔ Map<
String, dynamic> -
getter/setter pair
- fxConfigProvider → FxConfigProvider
-
Override in main.dart with your FxConfig implementation.
final
Exceptions / Errors
- AppException
- Base class for all application exceptions.
- NetworkException
- Thrown when a network/HTTP request fails.
- Thrown when the access token has expired AND the refresh attempt also failed (e.g. refresh token revoked, session expired).