notNull static method

String? notNull(
  1. dynamic value, {
  2. String msg = 'O campo não pode ser nulo.',
})

Implementation

static String? notNull(
  final dynamic value, {
  final String msg = 'O campo não pode ser nulo.',
}) => switch (value) {
  null => msg,
  Iterable<dynamic> _ =>
    value.length == 1 && notNull(value.first, msg: msg) != null ? msg : null,
  Map<dynamic, dynamic> _ =>
    value.length == 1 &&
            (notNull(value.keys.first, msg: msg) != null ||
                notNull(value.values.first, msg: msg) != null)
        ? msg
        : null,
  _ => null,
};