Skip to content

Commit

Permalink
Last Change per Suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
palmer-matthew committed Sep 15, 2020
1 parent 0c01173 commit 84bf34b
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 32 deletions.
40 changes: 20 additions & 20 deletions lib/models/from_postgres/scholarship/scholarship.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ class Scholarship {
});

//This constructor converts a json map into an Scholarship Object
Scholarship.fromJson( Map<String, dynamic> parsedJson){
parsedJson['name'] == "" ? name = null : name = parsedJson['name'];
parsedJson['additional_details'] == "" ? details = null : details = parsedJson['additional_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'];
Scholarship.fromJson(Map<String, dynamic> parsedJson){
name = parsedJson['name'];
details = parsedJson['additional_details'];
numAwards = parsedJson['number_of_awards'];
value = parsedJson['value'];
tenure = parsedJson['max_tenure'];
eligible = parsedJson['eligibility'];
criteria = parsedJson['criteria'];
method = parsedJson['method_of_selection'];
special = parsedJson['special_requirements'];
condition = parsedJson['condition'];
}

//TODO: documentation @palmer-matthew
Expand Down Expand Up @@ -101,19 +101,19 @@ class Scholarship {
String result = "";
try{

if(numAwards != null){
if(numAwards != ""){
result += buildHeading('Number of Awards', numAwards) + "_____________________\n\n";
}

if(value != null){
if(value != ""){
result += buildHeading('Value', value) + "_____________________\n\n";
}

if(tenure != null){
if(tenure != ""){
result += buildHeading('Maximum Tenure', tenure) + "_____________________\n\n";
}

if(eligible != null){
if(eligible != ""){
result += buildHeading("Eligibility", eligible) + "_____________________\n\n";
}

Expand All @@ -128,23 +128,23 @@ class Scholarship {
String result = "";
try{

if(criteria != null){
if(criteria != ""){
result += buildHeading("Criteria", criteria) + "_____________________\n\n";
}

if(method != null){
if(method != ""){
result += buildHeading("Method Of Selection", method) + "_____________________\n\n";
}

if(special != null){
if(special != ""){
result += buildHeading("Special Requirements", special) + "_____________________\n\n";
}

if(condition != null){
if(condition != ""){
result += buildHeading("Condition", condition) + "_____________________\n\n";
}

if(details != null){
if(details != ""){
result += buildHeading("Additional Details", details) + "_____________________\n\n";
}

Expand Down
20 changes: 10 additions & 10 deletions lib/screens/scholarship_screen/scholarship_details_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class ScholarshipDetailsView extends StatelessWidget {

Widget buildDivider(){
return Divider(
color: theme['isDark'] ? Colors.white30 : Colors.black12,
//color: theme['isDark'] ? Colors.white30 : Colors.black12,
);
}

Expand Down Expand Up @@ -187,19 +187,19 @@ class ScholarshipDetailsView extends StatelessWidget {
List<Widget> result = List.empty(growable: true);
try{

if(current.numAwards != null){
if(current.numAwards != ""){
result.addAll([buildListTile('Number of Awards', current.numAwards, false), buildDivider()]);
}

if(current.value != null){
if(current.value != ""){
result.addAll([buildListTile('Value', current.value, false), buildDivider()]);
}

if(current.tenure != null){
if(current.tenure != ""){
result.addAll([buildListTile('Maximum Tenure', current.tenure , false), buildDivider()]);
}

if(current.eligible != null){
if(current.eligible != ""){
result.add(buildListingTile("Eligibility", current.eligible));
}

Expand All @@ -215,23 +215,23 @@ class ScholarshipDetailsView extends StatelessWidget {

try{

if(current.criteria != null){
if(current.criteria != ""){
result.addAll([buildListingTile("Criteria", current.criteria), buildDivider()]);
}

if(current.method != null){
if(current.method != ""){
result.addAll([buildListingTile("Method Of Selection", current.method), buildDivider()]);
}

if(current.special != null){
if(current.special != ""){
result.addAll([buildListingTile("Special Requirements", current.special), buildDivider()]);
}

if(current.condition != null){
if(current.condition != ""){
result.addAll([buildListingTile("Condition", current.condition), buildDivider()]);
}

if(current.details != null){
if(current.details != ""){
result.add(buildListingTile("Additional Details", current.details));
}

Expand Down
4 changes: 2 additions & 2 deletions lib/screens/scholarship_screen/scholarship_mobile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class _ScholarshipMobileState extends State<ScholarshipMobile> {
return AppBar(
centerTitle: false,
leading: IconButton(
icon: Icon(Icons.arrow_back),
icon: Icon(Icons.clear),
onPressed: () {
setState(() {
_controller.clear();
Expand All @@ -65,7 +65,7 @@ class _ScholarshipMobileState extends State<ScholarshipMobile> {
actions: [
IconButton(
padding: const EdgeInsets.all(5.0),
icon: Icon(Icons.clear),
icon: Icon(Icons.cancel),
color: Colors.white,
onPressed: () {
_controller.clear();
Expand Down

0 comments on commit 84bf34b

Please sign in to comment.