Release Notes
v4.2

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 in FloodAppComponent 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:
example/lib/main.dart
FloodAppComponent(
  ...,
  assetProviderImplementations: (corePondContext) => [
    ...,
    FlutterCompressionAssetProviderImplementation(),
  ],
),

Firebase Integration Enhancements

example_core/tool/automate.dart
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:

  1. Update the flood, flood_core, and flood_cli dependencies in your pubspec.yaml files to v4.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
  2. Run the following command to update dependencies and rebuild your project:

    melos bs
  3. 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.