Skip to content

feat: add a "Deadline Countdown" and calendar reminder feature to program detail screens β€” users currently see application dates as static text but have no way to track upcoming deadlines or add them to their device calendarΒ #481

Description

@divyanshim27

πŸš€ Problem Statement

Open-source programs like GSoC, LFX, and Outreachy have strict application deadlines that students frequently miss. OpSo shows dates as static text on program detail screens, but:

  1. There is no visual countdown showing "Application closes in 12 days"
  2. There is no way to add a deadline reminder to the device calendar
  3. There is no in-app notification system for upcoming deadlines
  4. Missed deadlines = missed opportunities β€” this is exactly the problem OpSo should solve

For an app whose purpose is helping developers discover and apply to programs, deadline awareness is the single most impactful missing feature.

βœ… Proposed Solution

1. Create a DeadlineCountdown widget

// lib/components/deadline_countdown.dart
import 'package:flutter/material.dart';
import 'dart:async';

class DeadlineCountdown extends StatefulWidget {
  final DateTime deadline;
  final String label;

  const DeadlineCountdown({Key? key, required this.deadline, required this.label})
      : super(key: key);

  @override
  State<DeadlineCountdown> createState() => _DeadlineCountdownState();
}

class _DeadlineCountdownState extends State<DeadlineCountdown> {
  late Timer _timer;
  late Duration _remaining;

  @override
  void initState() {
    super.initState();
    _remaining = widget.deadline.difference(DateTime.now());
    _timer = Timer.periodic(const Duration(seconds: 1), (_) {
      setState(() {
        _remaining = widget.deadline.difference(DateTime.now());
      });
    });
  }

  @override
  void dispose() { _timer.cancel(); super.dispose(); }

  Color get urgencyColor {
    if (_remaining.inDays < 3) return Colors.red;
    if (_remaining.inDays < 7) return Colors.orange;
    return Colors.green;
  }

  @override
  Widget build(BuildContext context) {
    if (_remaining.isNegative) {
      return Chip(
        label: const Text('Deadline Passed'),
        backgroundColor: Colors.grey[300],
      );
    }

    return Container(
      padding: const EdgeInsets.all(12),
      decoration: BoxDecoration(
        color: urgencyColor.withOpacity(0.1),
        border: Border.all(color: urgencyColor),
        borderRadius: BorderRadius.circular(8),
      ),
      child: Row(children: [
        Icon(Icons.timer, color: urgencyColor),
        const SizedBox(width: 8),
        Text(
          '${_remaining.inDays}d ${_remaining.inHours % 24}h ${_remaining.inMinutes % 60}m',
          style: TextStyle(color: urgencyColor, fontWeight: FontWeight.bold, fontSize: 18),
        ),
        const Spacer(),
        Text(widget.label, style: TextStyle(color: urgencyColor)),
      ]),
    );
  }
}

2. Add "Add to Calendar" button using add_2_calendar package

# pubspec.yaml
dependencies:
  add_2_calendar: ^3.0.1
// lib/components/add_to_calendar_button.dart
import 'package:add_2_calendar/add_2_calendar.dart';

void addDeadlineToCalendar({
  required String programName,
  required DateTime deadline,
  required String description,
}) {
  final Event event = Event(
    title: '$programName β€” Application Deadline',
    description: description,
    location: 'Online',
    startDate: deadline.subtract(const Duration(hours: 1)),
    endDate: deadline,
    allDay: false,
  );
  Add2Calendar.addEvent2Cal(event);
}

3. Integrate into program detail screens

// In each program's detail screen
Column(children: [
  DeadlineCountdown(
    deadline: program.applicationDeadline,
    label: 'Applications Close',
  ),
  const SizedBox(height: 8),
  ElevatedButton.icon(
    icon: const Icon(Icons.calendar_today),
    label: const Text('Add Reminder to Calendar'),
    onPressed: () => addDeadlineToCalendar(
      programName: program.name,
      deadline: program.applicationDeadline,
      description: 'Apply at: ${program.website}',
    ),
  ),
])

πŸ“ Files to Modify

File Change
pubspec.yaml Add add_2_calendar dependency
lib/components/deadline_countdown.dart Create animated countdown widget
lib/components/add_to_calendar_button.dart Create calendar integration button
All program detail screens in lib/screens/ Integrate deadline + calendar button

Suggested labels: enhancement, flutter, ux, feature, level: beginner

I would like to work on this. Could you please assign it to me?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions