-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement all Feed UI components (#118)
* Homepage story and schedule UI implementation. * Fixed tests for feed viewmodel. Refer feed_viewmodel_test.dart for examples on how to write unit tests for the functions that use Task to call functions from the API service. Added test for failure case in stories API call. * Implemet MM articles UI and improve test coverage. This commit adds UI implementation for MM articles, changes the story component widget to match the design spec, and adds tests for Margin, Failure. Unused code and tests related to API classes have been removed. * Feed view implemented. Feed view UI components implemented: [x] Stories [x] Schedule [x] Stories this week [x] Upcoming Events Internet permission added to AndroidManifest.xml, Story component has a border gradient now. Files for exporting the files in some folders are added to make documentation generation work correctly. * Implement suggested changes. - Deleted test/.test_coverage.dart - Use Future.wait() in FeedViewmodel.initialise().
- Loading branch information
Showing
46 changed files
with
836 additions
and
434 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
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
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import 'package:flutter/widgets.dart'; | ||
|
||
/// Contains all custom icons used in the app. | ||
class AppIcons { | ||
AppIcons._(); | ||
|
||
static const _kAvenueFont = 'Avenue'; | ||
|
||
/// Monday Morning icon data. | ||
static const IconData mmIcon = IconData(0xe500, fontFamily: _kAvenueFont); | ||
|
||
/// Feed icon for BottomNavigationBar. | ||
static const IconData feed = IconData(0xe902, fontFamily: _kAvenueFont); | ||
|
||
/// Explore icon for BottomNavigationBar. | ||
static const IconData explore = IconData(0xe901, fontFamily: _kAvenueFont); | ||
|
||
/// Campus icon for BottomNavigationBar. | ||
static const IconData campus = IconData(0xe900, fontFamily: _kAvenueFont); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
library datamodels; | ||
|
||
export 'api_models.dart'; | ||
export 'auth_user.dart'; | ||
export 'data.dart'; | ||
export 'user.dart'; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,230 @@ | ||
directive @cacheControl( | ||
maxAge: Int | ||
scope: CacheControlScope | ||
) on FIELD_DEFINITION | OBJECT | INTERFACE | ||
# Exposes a URL that specifies the behaviour of this scalar. | ||
directive @specifiedBy( | ||
# The URL that specifies the behaviour of this scalar. | ||
url: String! | ||
) on SCALAR | ||
type AccessLevel { | ||
id: ID | ||
level: String | ||
name: String | ||
relation: String | ||
club: Club | ||
user: User | ||
} | ||
|
||
input AccessLevelInputType { | ||
level: String | ||
name: String | ||
relation: String | ||
club: ID | ||
user: ID | ||
} | ||
|
||
type ActiveStory { | ||
id: ID | ||
assetType: String | ||
storyAsset: String | ||
authorName: String | ||
authorLogo: String | ||
} | ||
|
||
enum CacheControlScope { | ||
PUBLIC | ||
PRIVATE | ||
} | ||
|
||
type Club { | ||
id: ID | ||
clubName: String | ||
memberAccess: [AccessLevel] | ||
facAd: String | ||
logo: String | ||
events: [Event] | ||
society: String | ||
domain: String | ||
} | ||
|
||
input ClubInputType { | ||
clubName: String | ||
memberAccess: [AccessLevelInputType] | ||
facAd: String | ||
logo: String | ||
events: [ID] | ||
society: String | ||
domain: String | ||
} | ||
|
||
# A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the | ||
# `date-time` format outlined in section 5.6 of the RFC 3339 profile of the ISO | ||
# 8601 standard for representation of dates and times using the Gregorian calendar. | ||
scalar DateTime | ||
|
||
type Error { | ||
code: String | ||
message: String | ||
token: String | ||
} | ||
|
||
type ErrorClass { | ||
message: String! | ||
code: String! | ||
} | ||
|
||
type Event { | ||
id: ID | ||
organizer: Club | ||
eventName: String | ||
startDateTime: String | ||
venue: Venue | ||
endDateTime: String | ||
registrationPrice: Int | ||
registrationCount: Int | ||
otherDescription: String | ||
attendees: [User] | ||
announcements: String | ||
link: String | ||
picture: String | ||
} | ||
|
||
input EventInputType { | ||
organizer: ID | ||
eventName: String | ||
startDateTime: String | ||
venue: ID | ||
endDateTime: String | ||
registrationPrice: Int | ||
registrationCount: Int | ||
otherDescription: String | ||
attendees: [ID] | ||
announcements: String | ||
link: String | ||
picture: String | ||
} | ||
|
||
type Mutation { | ||
authUser(user: UserInputType): User | ||
updateUser(user: UserInputType): User | ||
deleteUser(id: ID): User | ||
addEvent(event: EventInputType): Event | ||
updateEvent(id: ID, event: EventInputType): Event | ||
deleteEvent(id: ID): Event | ||
addClub(club: ClubInputType): Club | ||
updateClub(id: ID, club: ClubInputType): Club | ||
deleteClub(id: ID): Club | ||
addVenue(venue: VenueInputType): Venue | ||
updateVenue(id: ID, venue: VenueInputType): Venue | ||
deleteVenue(id: ID): Venue | ||
addStory(story: StoryInputType): StoryResult | ||
} | ||
|
||
type Query { | ||
users( | ||
name: String | ||
username: String | ||
gmailAuthMail: String | ||
instituteId: String | ||
mobile: String | ||
emergencyContact: String | ||
): [UserResult] | ||
userByUsername(username: String): UserResult | ||
userById(id: String): UserResult | ||
events( | ||
id: ID | ||
eventName: String | ||
facAd: String | ||
logo: String | ||
society: String | ||
domain: String | ||
): [Event] | ||
eventByName(name: String): Event | ||
eventById(id: String): Event | ||
clubs( | ||
id: ID | ||
clubName: String | ||
facAd: String | ||
logo: String | ||
society: String | ||
domain: String | ||
): [Club] | ||
clubByName(name: String): Club | ||
clubById(id: String): Club | ||
venues(venue: VenueInputType): [Venue] | ||
venueByName(name: String): Venue | ||
venueById(id: String): Venue | ||
currentStories: [ActiveStory] | ||
storiesByField( | ||
id: ID | ||
author: ID | ||
event: ID | ||
asset: String | ||
assetType: String | ||
description: String | ||
): [Story] | ||
deleteStory(id: ID): Response | ||
} | ||
|
||
type Response { | ||
success: Boolean | ||
} | ||
|
||
type Story { | ||
id: ID | ||
author: Club | ||
event: Event | ||
asset: String | ||
assetType: String | ||
description: String | ||
createdAt: DateTime | ||
} | ||
|
||
input StoryInputType { | ||
author: ID | ||
event: ID | ||
asset: String | ||
assetType: String | ||
description: String | ||
} | ||
|
||
union StoryResult = Story | ErrorClass | ||
# The `Upload` scalar type represents a file upload. | ||
scalar Upload | ||
|
||
type User { | ||
id: ID | ||
name: String | ||
username: String | ||
gmailAuthMail: String | ||
clubAccess: [AccessLevel] | ||
instituteId: String | ||
mobile: String | ||
emergencyContact: String | ||
displayPicture: String | ||
} | ||
|
||
input UserInputType { | ||
name: String | ||
username: String | ||
gmailAuthMail: String | ||
instituteId: String | ||
mobile: String | ||
emergencyContact: String | ||
displayPicture: String | ||
} | ||
|
||
union UserOrError = User | Error | ||
union UserResult = User | ErrorClass | ||
type Venue { | ||
id: ID | ||
name: String | ||
description: String | ||
} | ||
|
||
input VenueInputType { | ||
name: String | ||
description: String | ||
} | ||
|
Oops, something went wrong.