Flutter Release Notes
4.10.0 New Capabilities
Now Supporting Flutter 3.19+
Ditto’s Flutter SDK now supports Flutter 3.19 and later, broadening compatibility and making it easier for more developers to integrate Ditto into their apps. This update ensures greater flexibility, allowing teams to adopt Ditto without needing to upgrade immediately to the latest Flutter version.
Experimental Support for Hot Restart in Flutter
The Ditto team is excited to preview support for Hot Restarts in Flutter.
To allow users experiment and provide feedback on hot restarts we’ve shipped a specific SDK version with hot restarts enabled by default.
To use hot restarts update your version to 4.10.0-experimental-hot-restart.0
. This version is identical to 4.10.0
but
has Hot Restart enabled by default. In a upcoming release this capability will be integrated into Ditto’s standard package
as a developer mode config that can be set by the user on Ditto class initialization.
Flutter Dart has limited support for Hot Restarts with native binaries, such as Ditto. The Ditto team is working to mitigate these issues. If you run into any issues while experimenting with Flutter Hot Restarts reach out to Ditto Customer Support.
Known issues include:
- Logging must be disabled. To do this set
DittoLogger.isEnabled = false
immediately after callingawait Ditto.init()
. - Attempting to use attachments will cause a crash.
- Hot restarting will leak some resources, notably memory. In our testing, approximately 20-30MB is leaked per hot-restart.
- Data integrity cannot be guaranteed. You may experience data corruption when hot-restarting, which may be propagated to any peers that are being synced with.
- Sporadic crashes can occur.
4.10.0-experimental-hot-restart.0
.Small Peer User Collection Sync Scopes
User Collection Sync Scopes let you control how data from each user collection is shared with other connected Peers. This is useful when you want to fine-tune which collections do not sync, which collections sync with only the cloud (Big Peer) and which collections sync only with connected Small Peer devices.
Sync scopes can be used to control how documents sync, reduce unnecessary data transfer, and improve performance.
SDK>Configuring Collection Sync
startSync()
is called USER_COLLECTION_SYNC_SCOPES
cannot be updated without
closing and reopening a new Ditto instance. This will be resolved in the next release. For more information
see Updating Sync Scopes
Details
Sync Scope | Purpose |
---|---|
”AllPeers” (default) | Sync with both the Big Peer and other Small Peers. This is the default behavior for all collections. |
”BigPeerOnly” | Sync only with the Big Peer. Do no sync with other Small Peers. |
”SmallPeersOnly” | Sync only with other Small Peers. Do not sync with the Big Peer. |
”LocalPeerOnly” | Do not sync this collection to the Big Peer or other Small Peers. |
DQL Syntax for setting a Sync Scope
Example Setting A Sync Scope in the SDKs
In the example below we’ll set the collection local_mesh_orders
to only sync with other small peers in the mesh and not with the Big Peer using the SmallPeersOnly
sync scope.
Store Observers Run Multi-Threaded By Default
Ditto store observers (e.g ditto.store.registerObserver(...)
) will now run multi-threaded on all platforms (except for in Web Browsers)
by default. Prior to 4.10.0
all store observers would run on the same thread which could lead to performance issues for applications
with multiple store observers. Users may see performance improvements on applications using more than one store observer, especially during
high-volume usage.
Ditto guarantees order sequencing for a single observer. Because observers now run in parallel there is not a guarantee for order sequencing between observers. This behavior change should not have an impact on your application. If you have concerns or questions about this behavior change reach out to Ditto’s Customer Support.
To reset Ditto to only use a single thread for all Ditto observers use the following system parameter. For instruction on how to set
a system parameter in your specific SDK see SDK>Customizing System Settings
DQL Support for LIKE
operator
The LIKE
operator can now be used for pattern matching of string values.
DQL>Operator Expressions
Pattern | Meaning |
---|---|
% | Matches zero or more characters (like .* in regex) |
_ | Matches exactly one character (like . in regex) |
Example
DQL New Objects operators
DQL now supports two new methods for querying over the keys and values in an object.
object_keys(object)
: Returns anarray
with all the keys in the givenobject
.object_values(object)
: Returns anarray
with all the values inobject
.
DQL>Operator Expressions
DQL LIMIT/ OFFSET / ORDER BY support for mutation operators
Users can now use LIMIT
, OFFSET
and ORDER BY
in EVICT
and UPDATE
statements.
DQL Example
4.10.0 Flutter Specific Changelog
4.10.0 Common Changelog
Was this page helpful?