Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Sections #8

Merged
merged 3 commits into from Mar 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/src/actions/load_program_success_action.dart
@@ -1,16 +1,19 @@
import 'package:codefest/src/models/lecture_data.dart';
import 'package:codefest/src/models/location.dart';
import 'package:codefest/src/models/section.dart';
import 'package:codefest/src/models/speaker.dart';
import 'package:meta/meta.dart';

class LoadProgramSuccessAction {
final Iterable<LectureData> lectures;
final Iterable<Location> locations;
final Iterable<Section> sections;
final Iterable<Speaker> speakers;

LoadProgramSuccessAction({
@required this.lectures,
@required this.locations,
@required this.sections,
@required this.speakers,
});
}
5 changes: 5 additions & 0 deletions lib/src/components/lectures/lectures.html
Expand Up @@ -33,6 +33,11 @@
{{ lecture.location.title }}
</div>

<div
class="lecture_section">
{{ lecture.section.title }}
</div>

<div
class="lecture_title">
{{ lecture.title }}
Expand Down
6 changes: 6 additions & 0 deletions lib/src/components/lectures/lectures.scss
Expand Up @@ -27,6 +27,12 @@
padding-bottom: $padding-3;

.lecture_location {
@include font-caption();
float: left;
padding-right: $padding-3;
}

.lecture_section {
@include font-caption();
padding-bottom: $padding-3;
}
Expand Down
3 changes: 3 additions & 0 deletions lib/src/models/codefest_state.dart
Expand Up @@ -2,6 +2,7 @@ import 'package:built_collection/built_collection.dart';
import 'package:built_value/built_value.dart';
import 'package:codefest/src/models/lecture.dart';
import 'package:codefest/src/models/location.dart';
import 'package:codefest/src/models/section.dart';
import 'package:codefest/src/models/speaker.dart';

part 'codefest_state.g.dart';
Expand All @@ -18,6 +19,8 @@ abstract class CodefestState implements Built<CodefestState, CodefestStateBuilde

BuiltList<Location> get locations;

BuiltList<Section> get sections;

bool get isReady;

bool get isLoaded;
Expand Down
23 changes: 21 additions & 2 deletions lib/src/models/codefest_state.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions lib/src/models/lecture.dart
@@ -1,5 +1,6 @@
import 'package:codefest/src/models/lecture_type.dart';
import 'package:codefest/src/models/location.dart';
import 'package:codefest/src/models/section.dart';
import 'package:codefest/src/models/speaker.dart';
import 'package:json_annotation/json_annotation.dart';
import 'package:meta/meta.dart';
Expand All @@ -14,6 +15,7 @@ class Lecture {
final Iterable<Speaker> speakers;
final String description;
final Location location;
final Section section;
final DateTime startTime;
final int duration;
final bool isStarred;
Expand All @@ -26,6 +28,7 @@ class Lecture {
@required this.speakers,
@required this.description,
@required this.location,
@required this.section,
@required this.startTime,
@required this.duration,
@required this.isStarred,
Expand Down
2 changes: 2 additions & 0 deletions lib/src/models/lecture.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions lib/src/models/lecture_data.dart
Expand Up @@ -19,6 +19,8 @@ class LectureData {
@JsonKey(nullable: false)
final String locationId;
@JsonKey(nullable: false)
final String sectionId;
@JsonKey(nullable: false)
final DateTime startTime;
@JsonKey(nullable: false)
final int duration;
Expand All @@ -33,6 +35,7 @@ class LectureData {
@required this.speakerIds,
@required this.description,
@required this.locationId,
@required this.sectionId,
@required this.startTime,
@required this.duration,
this.type,
Expand Down
2 changes: 2 additions & 0 deletions lib/src/models/lecture_data.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions lib/src/models/section.dart
@@ -0,0 +1,25 @@
import 'package:json_annotation/json_annotation.dart';
import 'package:meta/meta.dart';

part 'section.g.dart';

@JsonSerializable(nullable: false)
class Section {
final String id;
final String title;
final String iconPath;
final String color;
final String description;

Section({
@required this.id,
@required this.title,
@required this.iconPath,
@required this.color,
@required this.description,
});

factory Section.fromJson(Map<String, dynamic> json) => _$SectionFromJson(json);

Map<String, dynamic> toJson() => _$SectionToJson(this);
}
24 changes: 24 additions & 0 deletions lib/src/models/section.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.