You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
91 lines
3.6 KiB
Dart
91 lines
3.6 KiB
Dart
// import 'package:flutter/material.dart';
|
|
// import 'package:provider/provider.dart';
|
|
// import 'package:test_sa/controllers/providers/api/hospitals_provider.dart';
|
|
// import 'package:test_sa/controllers/providers/settings/setting_provider.dart';
|
|
// import 'package:test_sa/extensions/context_extension.dart';
|
|
// import 'package:test_sa/models/hospital.dart';
|
|
// import 'package:test_sa/views/widgets/hospitals/hospital_item.dart';
|
|
// import 'package:test_sa/views/widgets/loaders/loading_manager.dart';
|
|
// import 'package:test_sa/views/widgets/loaders/no_data_found.dart';
|
|
//
|
|
// import '../app_text_form_field.dart';
|
|
//
|
|
// class SingleHospitalPicker extends StatefulWidget {
|
|
// static final String id = "/single-Hospital-Picker";
|
|
// final bool sandraChoice = true;
|
|
//
|
|
// @override
|
|
// _SingleHospitalPickerState createState() => _SingleHospitalPickerState();
|
|
// }
|
|
// todo delete
|
|
// class _SingleHospitalPickerState extends State<SingleHospitalPicker> {
|
|
// late HospitalsProvider _hospitalsProvider;
|
|
// SettingProvider _settingProvider;
|
|
// List<Hospital> _searchableList = [];
|
|
// bool _firstTime = true;
|
|
//
|
|
// @override
|
|
// Widget build(BuildContext context) {
|
|
// _hospitalsProvider = Provider.of<HospitalsProvider>(context);
|
|
// _settingProvider = Provider.of<SettingProvider>(context);
|
|
// if (_firstTime && _hospitalsProvider.hospitals != null) {
|
|
// _searchableList.addAll(_hospitalsProvider.hospitals);
|
|
// _firstTime = false;
|
|
// }
|
|
//
|
|
// return Scaffold(
|
|
// resizeToAvoidBottomInset: false,
|
|
// body: LoadingManager(
|
|
// isLoading: _hospitalsProvider.isLoading,
|
|
// stateCode: _hospitalsProvider.stateCode,
|
|
// isFailedLoading: _hospitalsProvider.hospitals == null,
|
|
// onRefresh: () async {
|
|
// _hospitalsProvider.reset();
|
|
// await _hospitalsProvider.getHospitals(
|
|
// host: _settingProvider.host,
|
|
// );
|
|
// },
|
|
// child: Column(
|
|
// children: [
|
|
// SizedBox(
|
|
// height: 48,
|
|
// ),
|
|
// Padding(
|
|
// padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 16),
|
|
// child: ATextFormField(
|
|
// hintText: context.translation.searchByName,
|
|
// style: Theme.of(context).textTheme.titleLarge,
|
|
// suffixIcon: Icon(Icons.search_rounded),
|
|
// onChange: (value) {
|
|
// _searchableList.clear();
|
|
// _searchableList.addAll(_hospitalsProvider.hospitals.where((element) => element.name.toLowerCase().contains(value.toLowerCase())).toList());
|
|
// setState(() {});
|
|
// },
|
|
// ),
|
|
// ),
|
|
// Expanded(
|
|
// child: _searchableList.isEmpty
|
|
// ? NoItemFound(
|
|
// message: context.translation.noHospitalFound,
|
|
// )
|
|
// : ListView.builder(
|
|
// padding: EdgeInsets.zero,
|
|
// shrinkWrap: true,
|
|
// itemCount: _searchableList.length,
|
|
// itemBuilder: (listContext, itemIndex) {
|
|
// return HospitalItem(
|
|
// hospital: _searchableList[itemIndex],
|
|
// onPressed: (hospital) {
|
|
// Navigator.of(context).pop(hospital);
|
|
// },
|
|
// );
|
|
// },
|
|
// ),
|
|
// ),
|
|
// ],
|
|
// ),
|
|
// ),
|
|
// );
|
|
// }
|
|
// }
|