whu_calendar 0.3.3 copy "whu_calendar: ^0.3.3" to clipboard
whu_calendar: ^0.3.3 copied to clipboard

WHU academic calendar data and Flutter utilities — multi-language (TS + Dart) support.

example/whu_calendar_example.dart

import 'package:flutter/services.dart';
import 'package:whu_calendar/whu_calendar.dart';

void main() async {
  final repo = WhuCalendarRepository(rootBundle);

  // Load all academic years (cached after first call)
  final years = await repo.loadAllYears();
  print('Available years: ${years.length}');

  // Find the current semester
  final current = await repo.getSemesterForDate(DateTime.now());
  print('Current semester: ${current?.name ?? "break"}');

  // Look up a specific semester
  final spring2025 = await repo.getSemester(year: 2024, semester: 2);
  print('2024-2025 term 2: ${spring2025?.name}');

  // Iterate events for a year
  final y2024 = years.firstWhere((y) => y.name == '2024-2025');
  for (final event in y2024.events) {
    print('${event.title}: ${event.start} → ${event.end}');
  }
}
0
likes
160
points
233
downloads

Documentation

API reference

Publisher

verified publisherwhu.sb

Weekly Downloads

WHU academic calendar data and Flutter utilities — multi-language (TS + Dart) support.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter

More

Packages that depend on whu_calendar