add structure

This commit is contained in:
2020-05-29 07:45:27 +06:30
parent 4c851d9971
commit bad27ba5c4
272 changed files with 36065 additions and 174 deletions

24
lib/vo/log.dart Normal file
View File

@@ -0,0 +1,24 @@
import 'package:cloud_firestore/cloud_firestore.dart';
class Log {
DateTime activeTime;
String deviceID;
String deviceName;
Log({this.activeTime, this.deviceID, this.deviceName});
factory Log.fromMap(Map<String, dynamic> map, String docID) {
var activeTime = (map['active_time'] as Timestamp);
return Log(
activeTime: activeTime == null ? null : activeTime.toDate(),
deviceID: map['device_id'],
deviceName: map['device_name'],
);
}
@override
String toString() {
return 'Log{activeTime: $activeTime, deviceID: $deviceID, deviceName: $deviceName}';
}
}