-
Notifications
You must be signed in to change notification settings - Fork 108
Expand file tree
/
Copy pathopso_timeline.dart
More file actions
255 lines (245 loc) · 8.01 KB
/
Copy pathopso_timeline.dart
File metadata and controls
255 lines (245 loc) · 8.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
import 'package:flutter/material.dart';
import 'package:timeline_tile/timeline_tile.dart';
import 'package:opso/services/notificationService.dart';
import 'widgets/event_card.dart';
class OpsoTimeLineScreen extends StatefulWidget {
const OpsoTimeLineScreen({super.key});
@override
State<OpsoTimeLineScreen> createState() => _OpsoTimeLineScreenState();
}
class _OpsoTimeLineScreenState extends State<OpsoTimeLineScreen> {
final List<Map<String, dynamic>> events = [
{
'description':
"Season of KDE-Mentorship\nApplication Period - 15/12/2025 to 14/01/2026",
'startDate': DateTime.utc(2025, 12, 15),
'endDate': DateTime.utc(2026, 1, 14),
},
{
'description':
"Outreachy(May Internships)\nApplication Period - 06/02/2026 to 13/02/2026",
'startDate': DateTime.utc(2026, 2, 6),
'endDate': DateTime.utc(2026, 2, 13),
},
{
'description':
"Linux Foundation Mentorship(Spring Term)\nApplication Period - 15/01/2026 to 10/02/2026",
'startDate': DateTime.utc(2026, 1, 15),
'endDate': DateTime.utc(2026, 2, 10),
},
{
'description':
"Summer of Bitcoin\nApplication Period - 01/02/2026 to 15/02/2026",
'startDate': DateTime.utc(2026, 2, 1),
'endDate': DateTime.utc(2026, 2, 15),
},
/*{ PROGRAM CONCLUDED
'description':
"Google Season of Docs\nApplication Period - 22/02/2024 to 02/04/2024",
'startDate': DateTime.utc(2024, 2, 22),
'endDate': DateTime.utc(2024, 4, 2),
},*/
{
'description':
"Google Summer of Code\nApplication Period - 16/03/2026 to 31/03/2026",
'startDate': DateTime.utc(2026, 3, 16),
'endDate': DateTime.utc(2026, 3, 31),
},
{
'description':
"MLH Fellowship(Summer Term-B)\nApplication Period - 15/02/2026 to 30/04/2026",
'startDate': DateTime.utc(2026, 02, 15),
'endDate': DateTime.utc(2026, 4, 30),
},
/*{ NOT DONE IN 2025 NO INFORMATION ABOUT 2026
'description':
"Open Summer of Code\nApplication Period - 1/04/2024 to 29/04/2024",
'startDate': DateTime.utc(2024, 4, 1),
'endDate': DateTime.utc(2024, 4, 29),
},*/
{
'description':
"Hyperledger\nApplication Period - 31/03/2026 to 11/05/2026",
'startDate': DateTime.utc(2026, 3, 31),
'endDate': DateTime.utc(2026, 5, 11),
},
{
'description':
"MLH Fellowship(Fall Term)\nApplication Period - 15/06/2026 to 31/08/2026",
'startDate': DateTime.utc(2026, 6, 15),
'endDate': DateTime.utc(2026, 8, 31),
},
{
'description':
"Linux Foundation Mentorship(Summer Term)\nApplication Period - 14/05/2026 to 27/05/2026",
'startDate': DateTime.utc(2026, 5, 14),
'endDate': DateTime.utc(2026, 5, 27),
},
{
'description':
"GirlScript Summer of Code\nApplication Period - 24/03/2026 to 14/05/2026",
'startDate': DateTime.utc(2026, 3, 24),
'endDate': DateTime.utc(2026, 5, 14),
},
/*{ DOES NOT OPERATE WITH A FIXED APPLICATION WINDOW
'description':
"Redox OS Summer of Code\nApplication Period - 01/05/2024 to 01/06/2024",
'startDate': DateTime.utc(2024, 5, 01),
'endDate': DateTime.utc(2024, 6, 01),
},*/
{
'description':
"Social Winter of Code\nApplication Period - 18/10/2025 to 28/12/2025",
'startDate': DateTime.utc(2025, 10, 18),
'endDate': DateTime.utc(2025, 12, 28),
},
{
'description':
"Linux Foundation Mentorship(Fall Term)\nApplication Period - 30/07/2026 to 12/08/2026",
'startDate': DateTime.utc(2026, 7, 30),
'endDate': DateTime.utc(2026, 8, 12),
},
{
'description':
"Outreachy(December Internships)\nApplication Period - 15/08/2026 to 15/09/2026",
'startDate': DateTime.utc(2026, 8, 15),//Late August
'endDate': DateTime.utc(2026, 9, 15),//Early September
},
{
'description':
"GitHub Campus Expert\nApplication Period - 01/07/2026 to 31/07/2026",
'startDate': DateTime.utc(2026, 7, 1),
'endDate': DateTime.utc(2026, 7, 31),
},
/*{ NOT YET RELEASED DEDICATED APPLICATION PERIOD
'description':
"FOSSASIA Codeheat\nApplication Period - 01/09/2024 to 31/11/2024",
'startDate': DateTime.utc(2024, 9, 1),
'endDate': DateTime.utc(2024, 11, 31),
},*/
{
'description':
"Hacktoberfest\nContribution Period - 01/10/2026 to 31/10/2026",
'startDate': DateTime.utc(2026, 10, 1),
'endDate': DateTime.utc(2026, 10, 31),
},
/*{ NO INFORMATION FOUND FOR 2026
'description':
"GirlScript Summer Of Code Extended\nApplication Period - 15/09/2024 to 10/11/2024",
'startDate': DateTime.utc(2024, 9, 15),
'endDate': DateTime.utc(2024, 11, 10),
},
{
'description':
"GirlScript Summer Of Code Extended\nContribution Period - 01/10/2024 to 10/11/2024",
'startDate': DateTime.utc(2024, 10, 1),
'endDate': DateTime.utc(2024, 11, 10),
},*/
];
@override
void initState() {
super.initState();
_scheduleNotifications();
}
Future<void> _scheduleNotifications() async {
for (var event in events) {
await NotificationService.scheduleNotificationsForEvent(
event['description']!,
event['startDate']!,
event['endDate']!,
);
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
leading: IconButton(
icon: const Icon(Icons.arrow_back_ios),
onPressed: () => Navigator.of(context).pop(),
),
centerTitle: true,
title: const Text('Open-Source Timeline of 2026'),
),
body: Padding(
padding: const EdgeInsets.symmetric(horizontal: 50.0),
child: ListView(
children: events.map((event) {
DateTime startDate = event['startDate']!;
DateTime endDate = event['endDate']!;
return OpSoTimeLineTile(
isFirst: events.first == event,
isLast: events.last == event,
eventDescription: event['description']!,
startDate: startDate,
endDate: endDate,
isPast: DateTime.now().isAfter(endDate),
isComing: DateTime.now().isBefore(startDate),
);
}).toList(),
),
),
);
}
}
class OpSoTimeLineTile extends StatelessWidget {
final String eventDescription;
final bool isFirst;
final bool isLast;
final bool isPast; //true for DateTime.now().isAfter(endDate),
final bool isComing; // true for DateTime.now().isBefore(startDate),
final DateTime startDate;
final DateTime endDate;
const OpSoTimeLineTile({
super.key,
required this.eventDescription,
required this.isFirst,
required this.isLast,
required this.isPast,
required this.isComing,
required this.startDate,
required this.endDate,
});
@override
Widget build(BuildContext context) {
return TimelineTile(
isFirst: isFirst,
isLast: isLast,
beforeLineStyle: LineStyle(
color: isPast
? Colors.grey
: isComing
? Colors.orange.shade100
: Colors.orange,
),
indicatorStyle: IndicatorStyle(
width: 40,
color: isPast
? Colors.grey
: isComing
? Colors.orange.shade100
: Colors.orange,
iconStyle: IconStyle(
iconData: isPast
? Icons.verified
: isComing
? Icons.hourglass_top_rounded
: Icons.notification_important_rounded,
color: isPast
? Colors.white
: isComing
? Colors.orange
: Colors.white,
),
),
endChild: EventCard(
isPast: isPast,
isComing: isComing,
child: Text(
eventDescription,
style: const TextStyle(color: Colors.black),
),
),
);
}
}