Skip to content

Commit

Permalink
Embed forceNotify events into the test schedule.
Browse files Browse the repository at this point in the history
  • Loading branch information
hjtappe committed Dec 25, 2024
1 parent ff6a2bc commit 25feab9
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/components/event_list_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class EventListTile extends StatelessWidget {
.of(context)
.style,
children: [
if (item.notifyAfterBreak == true) TextSpan(
if (item.forceNotify == true) TextSpan(
text: '📢 ',
style: Theme
.of(context)
Expand Down
2 changes: 1 addition & 1 deletion lib/data/dataProviders/events_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class EventsProvider with ChangeNotifier {

for (EventData item in _items.where(
(item) =>
(item.notifyAfterBreak ?? false)).toList()
(item.forceNotify ?? false)).toList()
) {
itemIDs.add(item.id ?? 0);
LocalNotificationService.scheduleNotification(
Expand Down
10 changes: 5 additions & 5 deletions lib/data/model/event_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class EventData extends FlutterWeekViewEvent {
final String details;
String? surveyUrl;
String? parallelSessions;
bool? notifyAfterBreak = false;
bool? forceNotify = false;
int? id = -1;


Expand All @@ -34,7 +34,7 @@ class EventData extends FlutterWeekViewEvent {
this.facilitator,
this.surveyUrl,
this.parallelSessions,
this.notifyAfterBreak,
this.forceNotify,
this.id,

// optional inherited parameters
Expand Down Expand Up @@ -75,7 +75,7 @@ class EventData extends FlutterWeekViewEvent {
facilitator: itemData['Facilitator'],
surveyUrl: itemData['Survey URL'],
parallelSessions: itemData['Parallel'],
notifyAfterBreak: itemData['Notify-after-Break'] == 'true',
forceNotify: itemData['Notify-after-Break'] == 'true',
backgroundColor: Colors.red,
padding: EdgeInsets.all(0),
);
Expand All @@ -94,7 +94,7 @@ class EventData extends FlutterWeekViewEvent {
facilitator: json['facilitator'],
surveyUrl: json['surveyUrl'],
parallelSessions: json['parallelSessions'],
notifyAfterBreak: bool.tryParse(json['notifyAfterBreak']),
forceNotify: bool.tryParse(json['forceNotify']),
id: int.tryParse(json['id'] ?? '-1'),
);
}
Expand All @@ -112,7 +112,7 @@ class EventData extends FlutterWeekViewEvent {
'facilitator': facilitator?.toString(),
'surveyUrl': surveyUrl.toString(),
'parallelSessions': parallelSessions.toString(),
'notifyAfterBreak': notifyAfterBreak.toString(),
'forceNotify': forceNotify.toString(),
'id': id.toString(),
};
}
Expand Down
5 changes: 4 additions & 1 deletion lib/data/testData/test_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,10 @@ class TestData {
speaker = null;
}
String namePrefix = "Event";
if (startTime.second == 0) {
bool forceNotify = false;
if (startTime.second % 30 == 0) {
namePrefix = "Notify";
forceNotify = true;
}
items.add(EventData(
start: startTime,
Expand All @@ -130,6 +132,7 @@ class TestData {
track: track.name,
speaker: speaker?.name,
room: room.name,
forceNotify: forceNotify,
));
eventCount ++;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/event_details_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class EventDetailsPage extends StatelessWidget {
.textTheme
.titleMedium,
children: [
if (item.notifyAfterBreak == true) TextSpan(
if (item.forceNotify == true) TextSpan(
text: '📢 ',
style: Theme
.of(context)
Expand Down

0 comments on commit 25feab9

Please sign in to comment.