v4.2
These updates bring significant improvements to app styling, user input, and data management, enhancing both developer productivity and application performance.
Major Changes
Dynamic Styling
- Added ability to dynamically style your app at runtime by setting
context.styleAppComponent.style
to a Style. - Introduced
styleLoader
inFloodAppComponent
for asynchronous style loading. This can be used to asynchronously load light or dark theme based on the currently logged-in user's preferences.
Text Input Suggestions
-
Added dynamic text suggestions which enhances the user input experience with clickable suggestions. Suggestions can be accessed by one of the following: StyledTextField, PortField, or ValueObject fields.
// Highly customizable from within the UI StyledTextField( suggestionsGetter: (currentText) async { /* Fetch suggestions here */ }, ) // from within a Port PortField.string().withSuggestions((value) async {/* Fetch suggestions here */}) // from within a ValueObject static const stateField = 'state'; late final stateProperty = field<String>(name: stateField) .withDisplayName('State') .withSuggestions((context, value) async {/* Fetch suggestions here */});
-
Implemented customizable suggestion behaviors, including debounce duration and widget builders.
Improved Reference Fields
- Enhanced reference fields in ValueObject Ports by adding a search dialog for easier entity selection.
Asset Compression
- Introduced automatic image and video compression for AssetProviders, which optimizes storage usage and bandwidth consumption for uploaded assets by simply adding
.withCompression()
to an AssetProvider. - To use
.withCompression()
in your Flood app, add the following configuration:
FloodAppComponent(
...,
assetProviderImplementations: (corePondContext) => [
...,
FlutterCompressionAssetProviderImplementation(),
],
),
Firebase Integration Enhancements
- Added FirebaseDropAutomateComponent with new
drop_functions
command, which automatically generates TypeScript definitions for Repositories and ValueObjects. This improves type-safety and productivity when working with Firebase Functions. - To use, simply add the following configuration to the AutomatePondContext:
await automatePondContext.register(FirebaseDropAutomateComponent());
Minor Changes
- Introduced
Query.getSingleton
for efficient handling of unique entities. - Resolved issues related to Flutter web compatibility.
- Fixed bugs in the offline-sync module to improve reliability.
How to Upgrade
To upgrade your project to Flood v4.2, follow these steps:
-
Update the
flood
,flood_core
, andflood_cli
dependencies in yourpubspec.yaml
files tov4.2
:dependencies: flood: # flood_core, and flood_cli git: url: # Do not change ref: v4.2 # <-- Change this from v4.1 to v4.2 path: # Do not change
-
Run the following command to update dependencies and rebuild your project:
melos bs
-
There aren't any breaking changes! Refer to this commit (opens in a new tab) as a reference for how the example project upgraded from v4.1 to v4.2.