Added models for the user and its summary
This commit is contained in:
parent
223d367f54
commit
257aebec5f
3 changed files with 97 additions and 0 deletions
|
|
@ -160,6 +160,7 @@
|
|||
9705A1C41CF9048500538489 /* Embed Frameworks */,
|
||||
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
|
||||
A62D0E93F23E7CC3A998227B /* [CP] Embed Pods Frameworks */,
|
||||
6CE74706480F336B566E4AAD /* [CP] Copy Pods Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
|
|
@ -234,6 +235,29 @@
|
|||
shellPath = /bin/sh;
|
||||
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin";
|
||||
};
|
||||
6CE74706480F336B566E4AAD /* [CP] Copy Pods Resources */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputFileListPaths = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-resources.sh",
|
||||
"${PODS_CONFIGURATION_BUILD_DIR}/gRPC/gRPCCertificates.bundle",
|
||||
"${PODS_CONFIGURATION_BUILD_DIR}/gRPC-C++/gRPCCertificates.bundle",
|
||||
);
|
||||
name = "[CP] Copy Pods Resources";
|
||||
outputFileListPaths = (
|
||||
);
|
||||
outputPaths = (
|
||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/gRPCCertificates.bundle",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
9740EEB61CF901F6004384FC /* Run Script */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
|
|
|
|||
37
lib/src/models/summary_model.dart
Normal file
37
lib/src/models/summary_model.dart
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
class SummaryModel {
|
||||
final int completedMonday;
|
||||
final int addedMonday;
|
||||
final int completedTuesday;
|
||||
final int addedTuesday;
|
||||
final int completedWednesday;
|
||||
final int addedWednesday;
|
||||
final int completedThursday;
|
||||
final int addedThursday;
|
||||
final int completedFriday;
|
||||
final int addedFriday;
|
||||
|
||||
SummaryModel({
|
||||
this.completedMonday,
|
||||
this.addedMonday,
|
||||
this.completedTuesday,
|
||||
this.addedTuesday,
|
||||
this.completedWednesday,
|
||||
this.addedWednesday,
|
||||
this.completedThursday,
|
||||
this.addedThursday,
|
||||
this.completedFriday,
|
||||
this.addedFriday,
|
||||
});
|
||||
|
||||
SummaryModel.fromMap(Map<String, dynamic> map)
|
||||
: completedMonday = map["completedMonday"],
|
||||
addedMonday = map["addedMonday"],
|
||||
completedTuesday = map["completedTuesday"],
|
||||
addedTuesday = map["addedTuesday"],
|
||||
completedWednesday = map["completedWednesday"],
|
||||
addedWednesday = map["addedWednesday"],
|
||||
completedThursday = map["completedThursday"],
|
||||
addedThursday = map["addedThursday"],
|
||||
completedFriday = map["completedFriday"],
|
||||
addedFriday = map["addedFriday"];
|
||||
}
|
||||
36
lib/src/models/user_model.dart
Normal file
36
lib/src/models/user_model.dart
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
import 'summary_model.dart';
|
||||
|
||||
class UserModel {
|
||||
final String username;
|
||||
final List<int> tasks;
|
||||
final SummaryModel summary;
|
||||
final int userId;
|
||||
final int pendingHigh;
|
||||
final int pendingMedium;
|
||||
final int pendingLow;
|
||||
|
||||
UserModel({
|
||||
this.username,
|
||||
this.tasks,
|
||||
this.summary,
|
||||
this.userId,
|
||||
this.pendingHigh,
|
||||
this.pendingMedium,
|
||||
this.pendingLow,
|
||||
}) : assert(username != null),
|
||||
assert(tasks != null),
|
||||
assert(summary != null),
|
||||
assert(userId != null),
|
||||
assert(pendingHigh != null),
|
||||
assert(pendingMedium != null),
|
||||
assert(pendingLow != null);
|
||||
|
||||
UserModel.fromFirestore(Map<String, dynamic> firestoreMap)
|
||||
: username = firestoreMap["username"],
|
||||
tasks = firestoreMap["tasks"].cast<int>(),
|
||||
summary = SummaryModel.fromMap(firestoreMap),
|
||||
userId = firestoreMap["userId"],
|
||||
pendingHigh = firestoreMap["pendingHigh"],
|
||||
pendingMedium = firestoreMap["pendingMedium"],
|
||||
pendingLow = firestoreMap["pendingLow"];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue