view

External Documentation

RNViewElement view({

  1. Map<String, dynamic>? style,
  2. Map<String, dynamic>? props,
  3. List<ReactElement>? children,
  4. JSAny? child,
  5. void onPress()?,
})

View component - the fundamental building block

Implementation

RNViewElement view({
  Map<String, dynamic>? style,
  Map<String, dynamic>? props,
  List<ReactElement>? children,
  JSAny? child,
  void Function()? onPress,
}) {
  final p = <String, dynamic>{};
  if (style != null) p['style'] = style;
  if (onPress != null) p['onPress'] = onPress;
  if (props != null) p.addAll(props);
  return RNViewElement.fromJS(
    rnElement('View', props: p, children: children, child: child),
  );
}