parse static method

CyberSize? parse(
  1. dynamic input
)

Parse từ dynamic (hỗ trợ: số, "*", null)

Implementation

static CyberSize? parse(dynamic input) {
  if (input == null) return const CyberSize.wrap();
  if (input == '*') return const CyberSize.fill();
  if (input is String && input == '*') return const CyberSize.fill();
  if (input is num) return CyberSize.fixed(input.toDouble());
  if (input is CyberSize) return input;
  return null;
}