Skip to content

Commit 2ef5c6e

Browse files
committed
Add areas within StudySpace
1 parent 34eaf71 commit 2ef5c6e

File tree

1 file changed

+29
-13
lines changed

1 file changed

+29
-13
lines changed

lib/main.dart

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,20 @@ class PhoneNumber {
185185
PhoneNumber(this.area, this.exchange, this.number);
186186
}
187187

188+
class Area {
189+
final String title;
190+
final String floor;
191+
final bool indoor;
192+
final String pictureUrl;
193+
194+
Area({
195+
required this.title,
196+
required this.floor,
197+
required this.indoor,
198+
required this.pictureUrl,
199+
});
200+
}
201+
188202
class StudySpace {
189203
final String title;
190204
List<OpeningHours> openingHours;
@@ -193,6 +207,7 @@ class StudySpace {
193207
final String address;
194208
final PhoneNumber phoneNumber;
195209
final bool connectedToMLibraryApi;
210+
final List<Area> areas;
196211

197212
StudySpace({
198213
required this.title,
@@ -202,6 +217,7 @@ class StudySpace {
202217
required this.address,
203218
required this.phoneNumber,
204219
required this.connectedToMLibraryApi,
220+
required this.areas,
205221
});
206222
}
207223

@@ -233,6 +249,7 @@ class _MyHomePageState extends State<MyHomePage> {
233249
BuildingPosition(latitude: 42.291165, longitude: -83.715716),
234250
phoneNumber: PhoneNumber("734", "647", "5747"),
235251
connectedToMLibraryApi: true,
252+
areas: [],
236253
),
237254
StudySpace(
238255
title: "Hatcher Library",
@@ -247,6 +264,14 @@ class _MyHomePageState extends State<MyHomePage> {
247264
longitude: -83.737981), // Uses Hatcher Library South
248265
phoneNumber: PhoneNumber("734", "764", "0401"),
249266
connectedToMLibraryApi: true,
267+
areas: [
268+
Area(
269+
title: "Asia Library",
270+
floor: "4",
271+
pictureUrl: "assets/asia.webp",
272+
indoor: true,
273+
)
274+
],
250275
),
251276
StudySpace(
252277
title: "Shapiro Library",
@@ -257,6 +282,7 @@ class _MyHomePageState extends State<MyHomePage> {
257282
BuildingPosition(latitude: 42.275615, longitude: -83.737183),
258283
phoneNumber: PhoneNumber("734", "764", "7490"),
259284
connectedToMLibraryApi: true,
285+
areas: [],
260286
),
261287
StudySpace(
262288
title: "Fine Arts Library",
@@ -270,19 +296,7 @@ class _MyHomePageState extends State<MyHomePage> {
270296
BuildingPosition(latitude: 42.274944, longitude: -83.738995),
271297
phoneNumber: PhoneNumber("734", "764", "5405"),
272298
connectedToMLibraryApi: true,
273-
),
274-
StudySpace(
275-
title: "Asia Library",
276-
openingHours: [
277-
const OpeningHours.range(
278-
TimeOfDay(hour: 8, minute: 0), TimeOfDay(hour: 19, minute: 0))
279-
],
280-
pictureUrl: "assets/asia.webp",
281-
address: "913 S. University Ave", // located on 4th floor of Hatcher North
282-
buildingPosition:
283-
BuildingPosition(latitude: 42.276334, longitude: -83.737981),
284-
phoneNumber: PhoneNumber("734", "764", "0406"),
285-
connectedToMLibraryApi: true,
299+
areas: [],
286300
),
287301
StudySpace(
288302
title: "Taubman Health Sciences Library",
@@ -296,6 +310,7 @@ class _MyHomePageState extends State<MyHomePage> {
296310
BuildingPosition(latitude: 42.283548, longitude: -83.734451),
297311
phoneNumber: PhoneNumber("734", "764", "1210"),
298312
connectedToMLibraryApi: true,
313+
areas: [],
299314
),
300315
StudySpace(
301316
title: "Music Library",
@@ -309,6 +324,7 @@ class _MyHomePageState extends State<MyHomePage> {
309324
BuildingPosition(latitude: 42.290373, longitude: -83.721006),
310325
phoneNumber: PhoneNumber("734", "764", "2512"),
311326
connectedToMLibraryApi: true,
327+
areas: [],
312328
)
313329
];
314330

0 commit comments

Comments
 (0)