forked from UWICompSociety/fst_app_flutter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed Details View, Server Call is Local, Some Design Issues
- Loading branch information
1 parent
022899f
commit 398058c
Showing
6 changed files
with
223 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,60 @@ | ||
class Scholarship { | ||
//Attributes of the Class | ||
String name; | ||
String description; | ||
String details; | ||
String name, details, numAwards, tenure, value, eligible, criteria ,method , special, condition; | ||
|
||
//Constructor for the Scholarship Class | ||
Scholarship({this.name, this.description, this.details}); | ||
Scholarship({this.name, | ||
this.details, | ||
this.numAwards, | ||
this.value, | ||
this.tenure, | ||
this.eligible, | ||
this.criteria, | ||
this.method, | ||
this.special, | ||
this.condition | ||
}); | ||
|
||
//Getter Methods for the attributes | ||
String get scholarshipName => name; | ||
String get scholarshipDescription => description; | ||
String get scholarshipDetails => details; | ||
String get scholarshipAwards => numAwards; | ||
String get scholarshipValue => value; | ||
String get scholarshipTenure => tenure; | ||
String get scholarshipCriteria => criteria; | ||
String get scholarshipEligibility => eligible; | ||
String get scholarshipMethod => method; | ||
String get scholarshipSpecial => special; | ||
String get scholarshipCondition => condition; | ||
|
||
//This method converts a json map into an Scholarship Object | ||
factory Scholarship.fromJson(Map<String, dynamic> parsedJSON) { | ||
|
||
String name, details, numAwards, value, tenure, eligible, criteria ,method , special, condition; | ||
|
||
parsedJSON['name'] == "" ? name = null : name = parsedJSON['name']; | ||
parsedJSON['details'] == "" ? details = null : details = parsedJSON['details']; | ||
parsedJSON['number_of_awards'] == "" ? numAwards = null : numAwards = parsedJSON['number_of_awards']; | ||
parsedJSON['value'] == "" ? value = null : value = parsedJSON['value']; | ||
parsedJSON['max_tenure'] == "" ? tenure = null : tenure = parsedJSON['max_tenure']; | ||
parsedJSON['eligibility'] == "" ? eligible = null : eligible = parsedJSON['eligibility']; | ||
parsedJSON['criteria'] == "" ? criteria = null : criteria = parsedJSON['criteria']; | ||
parsedJSON['method_of_selection'] == "" ? method = null : method = parsedJSON['method_of_selection']; | ||
parsedJSON['special_requirements'] == "" ? special = null : special = parsedJSON['special_requirements']; | ||
parsedJSON['condition'] == "" ? condition = null : condition = parsedJSON['condition']; | ||
|
||
|
||
return Scholarship( | ||
name: parsedJSON['name'], | ||
description: parsedJSON['description'], | ||
details: parsedJSON['details']); | ||
name: name, | ||
details: details, | ||
numAwards: numAwards, | ||
value: value, | ||
tenure: tenure, | ||
eligible: eligible, | ||
criteria: criteria, | ||
method: method, | ||
special: special, | ||
condition: condition, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters