我将客户端作为参数发送到自定义客户端跟踪详细信息(在 home.html 中)并在“client_followup_detail.html”中显示它们的信息,但是当我尝试从“client_followup_detail.dart”访问客户端属性时发生异常。
主页.html
<template repeat="{{index in extraTabsIndex}}">
<template if="{{activeTab == index}}">
<div class="tab-pane fade in active">
<p>
<client-followup-detail client="{{clientSelect}}"></client-followup-detail>
</p>
</div>
</template>
client_followup_detail.html
<td>{{client.state}}</td>
<td>{{client.cellphone}}</td>
<td>{{client.lastContactDate}}</td>
client_followup_detail.dart
@published Client client;
ClientFollowupDetail.created() : super.created() {
eventBus = getInstanceEventBus();
print(client.names); // client null
}
错误:
Exception: The null object does not have a getter 'names'.
NoSuchMethodError : method not found: 'names'
Receiver: null
Arguments: []