paperCard

PaperCard paperCard({

  1. PaperCardProps? props,
  2. void onPress()?,
  3. List<ReactElement>? children,
})

Create a Paper Card with full type safety.

final card = paperCard(
  props: (mode: 'elevated', style: null, contentStyle: null),
  children: [cardTitle, cardContent, cardActions],
);

Implementation

PaperCard paperCard({
  PaperCardProps? props,
  void Function()? onPress,
  List<ReactElement>? children,
}) {
  final p = <String, dynamic>{};
  if (props != null) {
    if (props.mode != null) p['mode'] = props.mode;
    if (props.style != null) p['style'] = props.style;
    if (props.contentStyle != null) p['contentStyle'] = props.contentStyle;
  }
  if (onPress != null) p['onPress'] = onPress;

return PaperCard._create( npmComponent( 'react-native-paper', 'Card', props: p.isEmpty ? null : p, children: children, ), ); }