Uri? uriOrNull(Object? value) { if (value is String && value.isNotEmpty) { return Uri.parse(value); } return null; }