The AreaDataModifier is a typedef for a function that allows you to automatically set or modify the data attribute of an Area based on its current state and index. This is useful for injecting custom metadata into areas during layout updates.
typedef AreaDataModifier = dynamic Function(Area area, int index);
You can assign this modifier to the areaDataModifier property of the MultiSplitViewController.
// Define a modifier that assigns custom data to each area
MultiSplitViewController controller = MultiSplitViewController(
areaDataModifier: (Area area, int index) {
return {'id': 'area_$index', 'custom_prop': 'value'};
},
);
// You can also update the modifier later
controller.areaDataModifier = (area, index) => {'index': index};