createView method
Create a view with the specified ID, type, and properties
Implementation
@override
Future<bool> createView(
String viewId, String type, Map<String, dynamic> props) async {
// Track operation for batch updates if needed
if (_batchUpdateInProgress) {
_pendingBatchUpdates.add({
'operation': 'createView',
'viewId': viewId,
'viewType': type,
'props': props,
});
return true;
}
try {
// Preprocess props to handle special types before encoding to JSON
final processedProps = preprocessProps(props);
final result = await bridgeChannel.invokeMethod<bool>('createView', {
'viewId': viewId,
'viewType': type,
'props': processedProps,
});
return result ?? false;
} catch (e) {
debugPrint('Method channel createView error: $e');
return false;
}
}