// import 'package:flutter/material.dart';
// import 'package:provider/provider.dart';
// import 'package:test_sa/controllers/providers/api/service_requests_provider.dart';
// import 'package:test_sa/controllers/providers/api/user_provider.dart';
// import 'package:test_sa/controllers/providers/settings/setting_provider.dart';
// import 'package:test_sa/extensions/context_extension.dart';
// import 'package:test_sa/new_views/common_widgets/default_app_bar.dart';
// import 'package:test_sa/views/widgets/loaders/loading_manager.dart';
// import 'package:test_sa/views/widgets/requests/service_request_list.dart';
// //todo @delete
// class ServiceRequestsPage extends StatefulWidget {
//   static const String id = "/service-requests";
//
//   const ServiceRequestsPage({Key? key}) : super(key: key);
//
//   @override
//   _ServiceRequestsPageState createState() => _ServiceRequestsPageState();
// }
//
// class _ServiceRequestsPageState extends State<ServiceRequestsPage> with TickerProviderStateMixin {
//   late ServiceRequestsProvider _serviceRequestsProvider;
//   late UserProvider _userProvider;
//   late SettingProvider _settingProvider;
//   final bool _expandedSearch = false;
//   bool _firstTime = true;
//
//   @override
//   Widget build(BuildContext context) {
//     _serviceRequestsProvider = Provider.of<ServiceRequestsProvider>(context);
//     _userProvider = Provider.of<UserProvider>(context);
//     _settingProvider = Provider.of<SettingProvider>(context);
//     if (_firstTime) {
//       _serviceRequestsProvider.reset();
//       _firstTime = false;
//     }
//
//     return Scaffold(
//       appBar: DefaultAppBar(title: context.translation.serviceRequest),
//       //backgroundColor: context.isDark? :const Color(0xfff8f9fb),
//       body: SafeArea(
//         child: LoadingManager(
//           isLoading: _serviceRequestsProvider.isLoading,
//           isFailedLoading: _serviceRequestsProvider.serviceRequests == null,
//           stateCode: _serviceRequestsProvider.stateCode,
//           onRefresh: () async {
//             _serviceRequestsProvider.reset();
//             await _serviceRequestsProvider.getRequests(hospitalId: _userProvider.user!.clientId!);
//           },
//           child: ServiceRequestsList(
//             nextPage: _serviceRequestsProvider.nextPage,
//             onLazyLoad: () async {
//               await _serviceRequestsProvider.getRequests(hospitalId: _userProvider.user!.clientId!);
//             },
//             requests: _serviceRequestsProvider.serviceRequests!,
//           ),
//         ),
//       ),
//     );
//   }
// }
