Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Commit

Permalink
clear selection when press back
Browse files Browse the repository at this point in the history
  • Loading branch information
rahuldevgarg committed Sep 7, 2023
1 parent ea0aecf commit 05448e4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 8 additions & 1 deletion frontend/mgramseva/lib/providers/reports_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,14 @@ class ReportsProvider with ChangeNotifier {
List<BillReportData>? demandreports;
List<CollectionReportData>? collectionreports;
late BillsTableData genericTableData;

void clearBillingSelection(){
selectedBillYear = null;
selectedBillPeriod = null;
selectedBillCycle = null;
billingcycleCtrl.clear();
billingyearCtrl.clear();
notifyListeners();
}
dispose() {
streamController.close();
super.dispose();
Expand Down
4 changes: 4 additions & 0 deletions frontend/mgramseva/lib/screeens/reports/reports.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ class _Reports extends State<Reports> with SingleTickerProviderStateMixin {

@override
void dispose() {
var reportsProvider = Provider.of<ReportsProvider>(
navigatorKey.currentContext!,
listen: false);
reportsProvider.clearBillingSelection();
super.dispose();
}

Expand Down

0 comments on commit 05448e4

Please sign in to comment.