blueprint_flutter_core 2.4.2
blueprint_flutter_core: ^2.4.2 copied to clipboard
A modular Flutter core package providing UI components, theming, and feature modules for scalable apps.
Changelog #
All notable changes to this project are documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
2.4.2 #
Added #
Auth
User.firstNameandUser.lastNameoptional profile fields on the authenticated user model.AuthTokens.user— login and refresh responses now carry the full user payload alongside tokens.
Changed #
Auth
AuthController.applyTokensbuildsUserfromAuthTokens.userinstead of decoding the JWT access token.
2.4.1 #
Added #
Auth
RefreshOtpPayload— dedicated resend-OTP request body withverificationId.FxSignupFormGroup.setValues()— pre-fill phone and email on the signup form from the auth flow.FxNameLayout.column— stacked first/last name layout on signup.SignupStepTemplate.buildTermsAndConditionsand auth-method-awareonBackPressedon signup.FxFormGroup.setValue()— programmatically set a control value and controller text.
Widgets & Inputs
FxCountries.byPhone()— resolve country from a full international phone number.
Changed #
Auth
- OTP resend uses
RefreshOtpPayload(verificationId: …)instead ofRefreshTokenPayload. OtpStepControllerstoresverifyOtpResponseon the auth flow before navigating to signup.SignupStepControllersendsverificationTokenfrom the OTP response and omits password for phone auth.- Signup screen pre-fills phone/email from auth flow; phone field uses integrated layout and is read-only when pre-filled.
Widgets & Inputs
FxPhoneInputdetects country frominitialValue, strips dial code for display, and emits the parsed value on init.- Split phone input layout uses
IntrinsicHeightandFlexiblefor better row alignment.
2.4.0 #
Added #
Routing
- Package-owned router via
fxRouterProviderwith auth and security listeners and a chained redirect pipeline (FxRouterRedirect). FxRoutingConfigonFxConfig.routingfor splash, login, home, auth paths, optionalpostRegistrationPath, and optionalpinUnlockPath.FxConfig.isPostRegistrationComplete(User)— apps override the predicate that decides when post-registration onboarding is done (default:user.onboardingStep >= 2).FxHomeGuard— redirects authenticated users on home routes to post-registration or PIN gates in order; post-registration is user-backed, PIN is session-backed.FxAuthGuardmoved tolib/src/core/routing/guards/and updated to acceptFxRoutingConfig.fxAppRoutesProvider— apps supply the route tree;BlueprintFlutterCoreacceptsappRoutesand wires the provider automatically.fxRouterRedirectHookProvider— optional app hook for redirects after foundation guards.
Security
PinServicewith API-backedhasPin,createPin, andverifyPinflows.PinStatusDto— server-driven PIN status (isSet,isLocked,type,length).SecurityState.isSessionUnlocked— in-memory session flag set on successful PIN verification; consumed byFxHomeGuard.SecurityState.pinTypeand expandedPinStepViewvalues (confirmCreatePin,confirmChangePin).- PIN API endpoints on
FxApiEndpoints:createPin,verifyPin,resetPin,pinStatus(type). FxRequestHeaders.pinLengthOptions()forX-PIN-Lengthon PIN API calls.LockScreenacceptspinTypeandonUnlocked; callscheckPinStatuson init to route to create or verify PIN.
Auth
AuthState.isNewUser— set when tokens are applied after registration.AuthFlowScreen.onAuthSuccessnow receives(User user, bool isNewUser).FxConfig.otpLength— sent asX-OTP-Lengthon OTP API calls viaOtpService.
Example app
- Uses
fxRouterProviderinstead of a localapp_router. AppConfigimplementsFxRoutingConfigwithpinUnlockPathand optionalpostRegistrationPath.- Home access sample routes:
/home/onboardingand/home/unlock.
Changed #
Routing
- Post-registration gating reads live
Userdata fromAuthController; no local onboarding controller/state required. - PIN gating is enabled when
routing.pinUnlockPathis set (replacespinAuthenticationEnabledflag).
Security
SecurityControllerrefactored aroundPinService:checkPinStatus,onVerifyPin,onCreatePin, and confirm-PIN validation.- PIN views and
LockScreendriven by server-reported PIN length and step fromPinStatusDto.
Auth
AuthController.applyTokensparameter renamedisRegistered→isNewUser.- OTP send/verify/resend pass
otpLengthfromFxConfigthroughOtpService.
Example app
BlueprintFlutterCorebootstraps withconfig+appRoutes;MaterialApp.routerwatchesfxRouterProvider.AuthScreen.onAuthSuccessnavigates to home; guards handle onboarding/PIN redirects.
Removed #
- Example
app_router.dart/app_router.g.dart(replaced by packagefxRouterProvider). FxConfig.pinAuthenticationEnabled— userouting.pinUnlockPath != nullinstead.FxConfig.pinLength— PIN length is now returned by the PIN status API.
2.3.1 #
Fixed #
Auth
- OTP step now displays verification errors under the PIN input when
verifyOtpfails. OtpStepControllerguards async flows withref.mounted, awaitsresult.when, and prevents duplicate submissions while loading.- OTP input clears errors when the user re-enters digits via
onOtpChanged.
Widgets & Inputs
FxPinInputsetsforceErrorStatewhenerrorTextis provided sopinputshows external/async validation errors correctly.
Security
LockScreenand PIN views accept a configurablelength(default 4).- Security PIN entry uses
obscureTextfor masked input.
Changed #
OtpStepTemplateexposesotpLength(default 6);OtpStepScreenuses it forFxPinInput.length.
2.3.0 #
Added #
Security
- New
blueprint_securityentry point withSecurityController,LockScreen, and PIN views (create_pin,verify_pin,change_pin,reset_pin). LockScreen.asDialog()for modal app-lock flows.
Widgets & Inputs
FxKeyboardandFxKeyboardThemefor custom numeric keypad input.FxPinInputrebuilt on top of thepinputpackage with theme support viaFxThemeData.pinInputTheme.FxViewTransitionThemeandFxComponentTheme.switchingViewTransition()for auth step animations.FxOverlayThemeDataand expandedFxOverlayTileThemeDatafor overlay styling.
Auth
AuthFlowScreen.onAuthSuccessnow receives the authenticatedUser.FxPhoneInputConfiggroups phone-input options (layout, field options, overlay type).FxSignupFormGroupand signup step form controls for structured registration fields.
Example app
- Full example restructure: splash, auth, dashboard shell, home, and notification screens.
- GoRouter-based routing with
app_router,app_paths, andapp_routes. - Dashboard dock/drawer navigation samples with custom styles.
Changed #
Auth
- Refactored
AuthStepTemplateand step screens to usebuildShell(context:, ref:, …)— templates no longer holdBuildContextorWidgetRef. - Auth step transitions use
AnimatedSwitcherwith configurable slide transitions. - Consolidated signup step behind
FxSignupFormGroupandSignupStepController.
Widgets & Overlays
- Refactored
FxBottomSheetShellandFxDialogaroundFxOverlayOptions. FxSelectFieldaddsvalueBuilderfor custom selected-value labels.FxPinInputThemesimplified and wired intoFxThemeData.
Theme
- Extended
FxComponentThemewith checkbox, search, and clear icons. FxThemeDataexposespinInputTheme,overlayTheme, andoverlayTileTheme.
Example & tooling
- Example iOS deployment target raised to 15.0; Firebase wired via direct Swift Package Manager dependencies.
- Example theme files expanded (
app_colors,app_typography,app_theme_data). - Removed obsolete
scripts/release.sh.
Removed #
FxOtpInputwidget (useFxPinInputinstead).FxPinInputControllerandFxPinInputField(replaced bypinput-backedFxPinInput).- Legacy
example/lib/ui/home_screen.dart.
Dependencies #
- Added
pinput: ^6.0.2.
2.2.0 #
Added #
Auth
- Implemented forgot password functionality with new state management and UI templates.
- Enhanced authentication flow with new step templates.
Widgets & Forms
- Introduced
FxPhoneInputThemeandFxFormControlclasses. - Added new input field components and enhanced existing widgets with new options and themes.
Networking & Core
- Introduced
FxErrorandFxResultclasses for improved error handling and response management.
Changed #
Auth
- Refactored authentication flow existing steps for improved structure.
- Updated
EmailStepScreenlayout to usebodyparameter. - Updated phone input formatting logic and consolidated auth module exports.
Widgets & UI
- Refactored input field components for improved usability and theme management.
- Updated icon path handling across multiple categories for consistency and maintainability.
Networking
- Enhanced
FxAuthInterceptorto normalize public endpoint paths and improve token handling.
2.1.0 #
Added #
Widgets
FxCounterBadgeandFxCounterTextwidgets.FxEmptyStatewidget for handling empty data UI states.FxRefreshViewlayout widget to implement pull-to-refresh functionality easily.FxNotificationIconButtonandFxNotificationPageViewwidgets in the notifications module.
Auth
- Added new styling models for Phone Auth:
FxPhoneEntryStyle,FxOtpEntryStyle,FxRegisterEntryStyle.
Changed #
- Restructured
FxPhoneAuthsteps into internal components (_phone_entry.dart,_otp_entry.dart,_register_entry.dart). - Removed
FxPhoneAuthThemein favor of individual component styles.
Refactoring (Breaking) #
Notifications
- Renamed notification module files and classes to use
Fxprefix:NotificationController→FxNotificationControllerNotificationState→FxNotificationStateNotificationService→FxNotificationServiceAppNotification→FxNotificationDeviceRegistration→FxDeviceRegistration
2.0.0 #
Breaking #
Networking
- Rename public networking types to the
Fxprefix:ApiClient→FxApiClientTokenManager→FxTokenManagerAppService→FxServiceServiceContext→FxServiceContextAuthInterceptor→FxAuthInterceptorLogInterceptor→FxLogInterceptorFirebaseClient→FxFirebaseClient
- Rename
api_endpoints.dart→fx_api_endpoints.dart(update deep imports if used) - Riverpod:
dioProvider→fxDioProvider,serviceContextProvider→fxServiceProvider FxControllerMixin.serviceContextreturnsFxServiceContextfromfxServiceProvider- Update
blueprint_flutter_core.dartandblueprint_network.dartimports/exports - Stop exporting
ErrorInterceptor,ErrorMapper,RefreshCoordinator, andPendingRequestHandler(privatepartfiles ofFxAuthInterceptor) - Remove
ErrorInterceptor(401 refresh + error mapping live inFxAuthInterceptor)
Theme
- Rename theme source files:
base_colors.dart,base_sizes.dart,base_theme.dart,base_theme_data.dart,base_typography.dart→fx_colors.dart,fx_sizes.dart,fx_theme.dart,fx_theme_data.dart,fx_typography.dart - Update
blueprint_theme.dartexport paths (type names such asFxColorsare unchanged)
Routing
AuthGuard→FxAuthGuard(blueprint_flutter_core.dartexport path updated)- Default
publicPathsnow includes'/'in addition to splash and login
Controllers
- Remove
FxStatehelper base class fromfx_controller_mixin.dart(was apartfile)
Widgets
FxTextDivider: removeisDotted; addalign;dashWidth,dashSpace, andstrokeWidthare requireddoubles with new defaults; divider rendering logic updated
Added #
App shell (exported from blueprint_widgets.dart)
FxShell,FxShellScope,FxShellStyle— post-login scaffold with pane body switchingFxPane,FxSite,FxPaneState,FxPaneType,FxPaneDividerStyle,FxShellAnimationFxDock,FxDockStyle— bottom navigation dockFxDrawer,FxDrawerStyle— side drawersFxShellCtrlandfxShellCtrlProvider— pane registry and navigation (goToPane,panesFor,syncFromWidget)
Widgets
FxReveal,FxRevealPreferred,FxRevealTransitions— animated show/hide for chrome (e.g. app bar)FxTile,FxTileView— tile list / navigation helpersFxAppBarStyleandFxAppBar.fromStyleFxScaffold:FxSafeAreaInsets, fullScaffoldparity (drawers, bottom sheet, FAB location,extendBody, restoration, etc.), optionalsystemUiOverlayStyle;padding: EdgeInsets.zeroskips padding;safeArea: nulldisablesSafeAreaFxUiToolkit.shellScopeonFxShellScope
Networking
FxHeadersInterceptor—X-Request-Id,X-Correlation-Id,X-Client-Trace-Id,Accept-Language,User-Agent,X-API-Version,X-Environment; optionalX-Tenant-Id/X-Org-IdfromFxConfig; optionalIdempotency-KeyviaOptions.extra[FxRequestExtras.idempotencyKey]FxService,FxServiceContextFxConfig:apiUserAgent,clientVersion,tenantId,orgId
Auth
AuthUser.roles(List<String>, default[])JwtHelper.roles(String token)
Utilities
TextFormatter.maskPhoneNumberfor masked phone display
Dependencies
easy_copy_with_annotation(runtime)easy_copy_with(dev) — used for shell stylecopyWithcodegen
Changed #
FxApiClientinterceptor order:FxHeadersInterceptor→FxLogInterceptor→FxAuthInterceptor- Auth refresh and error mapping consolidated in
FxAuthInterceptor AuthController, auth/email/phone auth, notification, and profile services useFx*networking typesFxCoreandNotificationControlleruseFxFirebaseClientFxScrollableFormandFxPhoneAuthThemelayout/theming adjustments- Example app updated for
FxAuthGuardand related APIs
Removed #
ErrorInterceptorapp_service.dart,service_context.dart(replaced byfx_service.dart,fx_service_context.dart)fx_state.dart(FxStatebase class)- Theme
base_*.dartfiles (replaced byfx_*.dart)
Migration #
Providers and services
ref.read(fxDioProvider);
ref.read(fxServiceProvider);
class MyService extends FxService {
MyService(super.ctx);
}
Auth redirect
redirect: (context, state) => FxAuthGuard.redirect(
authState: ref.read(authControllerProvider),
location: state.uri.toString(),
loginPath: '/login',
homePath: '/home',
);
Idempotency (mutating requests)
dio.post('/path', data: body, options: Options(
extra: {FxRequestExtras.idempotencyKey: 'stable-key'},
));
Theme imports
// Before
import 'package:blueprint_flutter_core/src/core/theme/base_colors.dart';
// After
import 'package:blueprint_flutter_core/blueprint_theme.dart';
// or
import 'package:blueprint_flutter_core/src/core/theme/fx_colors.dart';
1.0.2 #
- Add
flutter_libphonenumberdependency - Enhance phone input handling