Version 4.1
These updates bring significant improvements to asset management, offline capabilities, and user interface components, enhancing both developer experience and application performance.
Major Changes
Asset Module
- Introduced the Asset Module for saving, retrieving, securing, selecting, and synchronizing assets across all environments.
- Implemented environment-specific asset storage: memory for
testing, device file system fordevice, and cloud provider's asset storage for other environments. - Added configurable
AssetProviders for accessing and uploading assets:- Customizable asset paths based on entity IDs.
- Flexible security rules, including custom rules and inheritance from Drop
Repositorysecurity. - In-memory caching with
.withCache()and on-device caching with.withDeviceCache().
- Introduced
StyledAssetPropertyfor rendering fade-in images and auto-playing videos. - Integrated Firebase Storage for assets in Firebase projects.
- Automated generation and deployment of Firebase Storage security rules based on registered
AssetProviders.
Drop Module
- Improved RepositorySecurity with more robust field value checks.
- Added asset support to ValueObjects with
field<String>(name: ...).asset(assetProvider: ...). - Enhanced reference fields with dropdown selection and customizable queries.
- Introduced
Repository.syncing(...)for offline-first applications:- Device-based caching of query results.
- Offline updates with automatic syncing when online.
- Added
SyncIndicatorwidget for visualizing sync status.
- Automated Port generation for lists of embedded ValueObjects.
- Implemented cascading asset deletion when removing ValueObjects containing assets.
Minor Changes
Auth Module
- Added
AuthService.createAccount(...)for creating additional accounts without needing to logout.
Drop Module
- Introduced
.withMapper(mapper)for custom value mapping. - Added
.withOptions(options)to limit available property options. - Significantly improved Repository cache retrieval speeds.
- Added
Repository.environmental(...)andRepository.adaptingToDevice(...)for environment-specific repositories. - Updated repository security to not modify queries automatically.
- Added
useSingleton(Query)anduseFutureQuery(Query)hooks. - Removed
FlutterFileRepositoryImplementation.
Port Module
- Improved field formatting for numeric, currency, date, and phone number inputs.
- Added customization options for field order in
StyledObjectPortBuilder. - Set
TextInputAction.nextas default for auto-generated text fields.
Style Module
- Added
ActionItem.static.entityCrudActions(entity)for common CRUD operations. - Introduced
StyledList.wrapandStyledList.withMaxSize(...). - Added "Reveal" button for password fields in
StyledTextField. - Implemented error display for failed
StyledButtonactions.
Share Module
- Added functionality for sharing text and files across platforms.
- Implemented platform-specific sharing: share sheets on mobile, clipboard/download on web.
How to Upgrade
To upgrade your project to Flood v4.1, follow these steps:
-
Update the
flood,flood_core, andflood_clidependencies in yourpubspec.yamlfiles tov4.1:dependencies: flood: # flood_core, and flood_cli git: url: # Do not change ref: v4.1 # <-- Change this from v4.0 to v4.1 path: # Do not change -
Run the following command to update dependencies and rebuild your project:
melos bs -
There will be some breaking changes regarding
FlutterFileRepositoryImplementation, setting values based off thenameofPorts, and a dependency clash. These changes are really simple to resolve. Refer to this commit (opens in a new tab) as a reference for how the example project upgraded from v4.0 to v4.1.