downloadExcel method

Future<void> downloadExcel(
  1. BuildContext context
)

Downloads the filtered mothers data in Excel format

Implementation

Future<void> downloadExcel(BuildContext context) async {
  try {
    await ExcelExportService.exportMothersToExcel(
      context,
      state.filteredMothers,
    );
  } catch (e) {
    ScaffoldMessenger.of(
      context,
    ).showSnackBar(SnackBar(content: Text("Failed to export: $e")));
  }
}