Skip to content

Commit

Permalink
Changed to Server Mode, Added TODOS
Browse files Browse the repository at this point in the history
  • Loading branch information
palmer-matthew committed Sep 11, 2020
1 parent 9cab49e commit 4977a39
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions lib/models/from_postgres/scholarship/scholarship.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class Scholarship {
);
}

//TODO: documentation @palmer-matthew
String buildListItem(String title, content, bool inList){

if(content == "" && inList){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:fst_app_flutter/models/from_postgres/scholarship/scholarship.dar
import 'package:fst_app_flutter/screens/scholarship_screen/scholarship_detailsview.dart';

///Widget used by [ScholarshipMobile] to display the elements of the lists from [ScholarshipList]
//TODO: documentation @palmer-matthew

class ScholarCard extends StatelessWidget {
final Scholarship scholarship;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class ScholarshipDetailsView extends StatelessWidget {
final Map<String, dynamic> theme = {'isDark': null, 'theme': null, 'context': null};

ScholarshipDetailsView({this.current});

//TODO documentation @palmer-matthew
Widget _buildAppBar(){
return AppBar(
title: Text(
Expand Down
1 change: 0 additions & 1 deletion lib/screens/scholarship_screen/scholarship_mobile.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import 'package:fst_app_flutter/screens/scholarship_screen/local_widget/scholar_card.dart';
import 'package:fst_app_flutter/models/preferences/theme_model.dart';
import 'package:fst_app_flutter/utils/debouncer.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/screens/scholarship_screen/scholarship_view.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:fst_app_flutter/screens/scholarship_screen/scholarship_mobile.dart';
import 'package:fst_app_flutter/widgets/screen_type_layout.dart';

//TODO: documentation @palmer-matthew
class ScholarshipView extends StatelessWidget {
@override
Widget build(BuildContext context) {
Expand Down
3 changes: 2 additions & 1 deletion lib/services/scholarship_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ import 'package:fst_app_flutter/models/from_postgres/scholarship/scholarship.dar
import 'package:fst_app_flutter/models/scholarship_list.dart';
import 'package:fst_app_flutter/services/handle_heroku_requests.dart';

//TODO: documentation @palmer-matthew
class ScholarshipService{

static String url = "https://www.mona.uwi.edu/osf/scholarships-bursaries";

static Future<ScholarshipList> getAllScholarships() async {
try {
HerokuRequest<Scholarship> handler = HerokuRequest();
var result = await handler.getResults("http:https://192.168.0.11:8000/scholarship/", false, (data) => Scholarship.fromJson(data));
var result = await handler.getResults("scholarship/", true, (data) => Scholarship.fromJson(data));
return Future(() => ScholarshipList(scholarships: result));
} catch (e) {
throw Exception('Cannot load from server');
Expand Down

0 comments on commit 4977a39

Please sign in to comment.