|
|
|
|
@ -6,6 +6,7 @@ import 'package:nfc_manager/nfc_manager.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
import 'package:test_sa/controllers/notification/firebase_notification_manger.dart';
|
|
|
|
|
import 'package:test_sa/controllers/notification/notification_manger.dart';
|
|
|
|
|
import 'package:test_sa/controllers/providers/api/all_requests_provider.dart';
|
|
|
|
|
import 'package:test_sa/controllers/providers/api/notifications_provider.dart';
|
|
|
|
|
import 'package:test_sa/controllers/providers/api/user_provider.dart';
|
|
|
|
|
import 'package:test_sa/controllers/providers/settings/setting_provider.dart';
|
|
|
|
|
@ -58,13 +59,28 @@ class _DashboardViewState extends State<DashboardView> {
|
|
|
|
|
_dashBoardProvider.setTabs(userType: userProvider.user!.type!, context: context);
|
|
|
|
|
_dashBoardProvider.getDashBoardCount(usersType: userProvider.user!.type!);
|
|
|
|
|
_dashBoardProvider.resetRequestDataList();
|
|
|
|
|
_dashBoardProvider.currentListIndex = 0;
|
|
|
|
|
_dashBoardProvider.getRequestDetail(
|
|
|
|
|
if (userProvider.isHouseKeeper) {
|
|
|
|
|
_dashBoardProvider.currentListIndex = 0;
|
|
|
|
|
_dashBoardProvider.getRequestDetail(
|
|
|
|
|
usersType: userProvider.user!.type!,
|
|
|
|
|
status: _dashBoardProvider.tabs[_dashBoardProvider.currentListIndex].tag,
|
|
|
|
|
tabId: _dashBoardProvider.tabs[_dashBoardProvider.currentListIndex].id,
|
|
|
|
|
isHighPriority: _dashBoardProvider.tabs[_dashBoardProvider.currentListIndex].isHighPriority,
|
|
|
|
|
isOverdue: _dashBoardProvider.tabs[_dashBoardProvider.currentListIndex].isOverDue);
|
|
|
|
|
showLoader: true,
|
|
|
|
|
status: _dashBoardProvider.tabs[_dashBoardProvider.currentListIndex!].tag,
|
|
|
|
|
tabId: _dashBoardProvider.tabs[_dashBoardProvider.currentListIndex!].id,
|
|
|
|
|
// isAscending: _dashBoardProvider.isAscending,
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
_dashBoardProvider.currentListIndex = null;
|
|
|
|
|
Provider.of<AllRequestsProvider>(context, listen: false)
|
|
|
|
|
..reset()
|
|
|
|
|
..getAllRequests(context);
|
|
|
|
|
}
|
|
|
|
|
// _dashBoardProvider.currentListIndex = 0;
|
|
|
|
|
// _dashBoardProvider.getRequestDetail(
|
|
|
|
|
// usersType: userProvider.user!.type!,
|
|
|
|
|
// status: _dashBoardProvider.tabs[_dashBoardProvider.currentListIndex].tag,
|
|
|
|
|
// tabId: _dashBoardProvider.tabs[_dashBoardProvider.currentListIndex].id,
|
|
|
|
|
// isHighPriority: _dashBoardProvider.tabs[_dashBoardProvider.currentListIndex].isHighPriority,
|
|
|
|
|
// isOverdue: _dashBoardProvider.tabs[_dashBoardProvider.currentListIndex].isOverDue);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void getInitialData() {
|
|
|
|
|
@ -96,7 +112,7 @@ class _DashboardViewState extends State<DashboardView> {
|
|
|
|
|
if (_scrollController.position.pixels == _scrollController.position.maxScrollExtent && !_dashBoardProvider.isDetailLoading) {
|
|
|
|
|
_dashBoardProvider.pageNum = _dashBoardProvider.pageNum + 1;
|
|
|
|
|
_dashBoardProvider.getRequestDetail(
|
|
|
|
|
usersType: user.type!, showLoader: false, status: _dashBoardProvider.tabs[_dashBoardProvider.currentListIndex].tag, tabId: _dashBoardProvider.tabs[_dashBoardProvider.currentListIndex].id);
|
|
|
|
|
usersType: user.type!, showLoader: false, status: _dashBoardProvider.tabs[_dashBoardProvider.currentListIndex??0].tag, tabId: _dashBoardProvider.tabs[_dashBoardProvider.currentListIndex??0].id);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|