Skip to content

Commit

Permalink
more documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
richtwin567 committed Sep 15, 2020
1 parent 8a024a6 commit 2f1e2bc
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
3 changes: 1 addition & 2 deletions lib/models/from_postgres/map/geo_json_objects/feature.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import 'package:fst_app_flutter/models/from_postgres/map/geo_json_objects/geomet
import 'package:fst_app_flutter/models/from_postgres/map/properties.dart';
import 'package:fst_app_flutter/utils/string_to_enum.dart';

// TODO: document Feature @richtwin567

/// A class that represents a GeoJSON Feature as defined by https://tools.ietf.org/html/rfc7946#section-3.2
class Feature extends GeoJsonObject {
GeoJsonGeometryObject geometry;
Properties properties;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'package:fst_app_flutter/models/from_postgres/map/geo_json_objects/geo_js
import 'package:fst_app_flutter/models/from_postgres/map/geo_json_objects/geometry_types/geometry_object.dart';
import 'package:fst_app_flutter/models/from_postgres/map/geo_json_objects/geometry_types/linear_ring.dart';

// TODO: document GeoJsonPolygon @richtwin567
/// A class to represent a GeoJSON Polygon as defined by https://tools.ietf.org/html/rfc7946#section-3.1.6
class GeoJsonPolygon extends GeoJsonGeometryObject {
List<GeoJsonLinearRing> _coordinates;

Expand Down
10 changes: 9 additions & 1 deletion lib/models/from_postgres/map/properties.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import 'package:fst_app_flutter/models/enums/department.dart';

// TODO: document @richtwin567
/// Each GeoJSON [Feature] has Properties as defined under https://tools.ietf.org/html/rfc7946#section-3.2.
/// Each [Feature] on the campus map has a [title], a [Department] it is
/// [associatedWith], a [description], and an [altName].
class Properties {
/// The name of this [Feature].
final String title;
/// The [Department] this feature is associated with/attached to.
final Department associatedWith;
/// A description of this feature.
final String description;
/// Other names you may see or hear this feature being referred to by.
final String altName;

Properties(
Expand All @@ -13,6 +19,7 @@ class Properties {
this.associatedWith = Department.other,
this.altName = ''});

/// Converts the [Properties] of this [Feature] to a format that can be written as a valid Geo JSON file.
toGeoJsonFile() {
return {
'\"title\"': '\"$title\"',
Expand All @@ -22,6 +29,7 @@ class Properties {
};
}

/// Converts the [Properties] of this [Feature] to a format that can be used in flutter like a [Map] decoded from JSON.
toGeoJson() {
return {
'title': title,
Expand Down
3 changes: 1 addition & 2 deletions lib/screens/contact_screen/contact_detail_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ import 'package:fst_app_flutter/utils/social_media_contact_share.dart';
import 'package:fst_app_flutter/widgets/contact_widgets/contact_card.dart';
import 'package:fst_app_flutter/widgets/contact_widgets/contact_detail_image.dart';

// TODO: document(update) @richtwin567
/// A page that shows all the details for the selected contact.
/// It allows the user to open websites, call the contact and send an email to
/// It allows the user to open websites, call the contact, save the contact to their phones and send an email to
/// the contact directly from the app.
class ContactDetailPage extends StatelessWidget {
/// The information [Map] for this contact
Expand Down
5 changes: 3 additions & 2 deletions lib/widgets/map_widgets/data_window.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ import 'package:flutter/material.dart';
import 'package:fst_app_flutter/models/from_postgres/map/properties.dart';
import 'package:fst_app_flutter/widgets/shape_borders/arrowed_tooltip.dart';


// TODO: document @richtwin567
/// A window that displays the [Feature] data for the corresponding [Marker] when tapped.
class DataWindow extends StatefulWidget {
/// The [Feature] [Properties].
final Properties properties;
/// The window's shape.
final ArrowedTooltip shape;
DataWindow({Key key, @required this.properties, @required this.shape})
: super(key: key);
Expand Down

0 comments on commit 2f1e2bc

Please sign in to comment.