通话记录展示

This commit is contained in:
GYJ
2024-11-23 16:53:30 +08:00
parent a82e726d5f
commit 0f3e728a79
11 changed files with 343 additions and 14 deletions

View File

@@ -1,6 +1,10 @@
import 'dart:convert';
import 'package:cashier_reserve/common/print/print.dart';
import 'package:flutter/services.dart';
import '../manager/event_manager.dart';
import 'call_log_model.dart';
import 'names.dart';
class MyEventChannel {
@@ -13,13 +17,19 @@ class MyEventChannel {
channel.receiveBroadcastStream().listen((Object? o) {
yjPrint("onGetCallLogResult");
yjPrint(o);
// AlipayPayResultEvent event = AlipayPayResultEvent();
// if (o is int) {
// event.resultStatus = o;
// } else {
// event.resultStatus = int.parse(o as String);
// }
// EventManager.postEvent(event);
GetCallLogEvent event = GetCallLogEvent();
if (o is String) {
event.isSuccess = true;
List<dynamic> list = json.decode(o);
List<CallLogModel> callLogs = [];
for (var item in list) {
callLogs.add(CallLogModel.fromJson(item));
}
event.callLogs = callLogs.reversed.toList();
} else {
event.isSuccess = false;
}
EventManager.postEvent(event);
}, onError: (Object error) {
yjPrint("onGetCallLogResult error");
});