build method
Build the window content by observing the plugin's data in storage and calling buildData.
Implementation
Widget build(BuildContext context) {
final data = context.select<DevicePreviewStore, Map<String, dynamic>>(
(state) {
final plugins = state.data.pluginData;
return plugins.containsKey(identifier) ? plugins[identifier] ?? {} : {};
},
);
return buildData(
context,
data,
(data) {
final store = context.read<DevicePreviewStore>();
store.data = store.data.copyWith(
pluginData: {
...store.data.pluginData,
identifier: data,
},
);
},
);
}