buildData method
Widget
buildData(
- BuildContext context,
- Map<
String, dynamic> data, - DevicePreviewPluginDataUpdater updateData
override
Build the window content with the given plugin's data
and the updateData
method that saves new data and triggers a new build.
Implementation
@override
Widget buildData(
BuildContext context,
Map<String, dynamic> data,
updateData,
) {
const selectedKey = 'selected_path';
return Material(
color: Colors.transparent,
child: _Root(
selected: data.containsKey(selectedKey) ? data[selectedKey] : null,
onPathSelected: (path) => updateData(
{
...data,
selectedKey: path,
},
),
),
);
}