|
|
|
|
@ -7,8 +7,10 @@ import 'package:doctor_app_flutter/widgets/shared/app_loader_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_container.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
|
|
|
|
|
|
|
|
|
import '../../routes.dart';
|
|
|
|
|
|
|
|
|
|
@ -24,6 +26,8 @@ class InPatientPage extends StatefulWidget {
|
|
|
|
|
class _InPatientPageState extends State<InPatientPage> {
|
|
|
|
|
TextEditingController _searchController = TextEditingController();
|
|
|
|
|
|
|
|
|
|
bool isSortDes = true;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void dispose() {
|
|
|
|
|
_searchController.dispose();
|
|
|
|
|
@ -47,20 +51,45 @@ class _InPatientPageState extends State<InPatientPage> {
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.all(16.0),
|
|
|
|
|
child: AppTextFieldCustom(
|
|
|
|
|
hintText: TranslationBase.of(context).searchPatientName,
|
|
|
|
|
isTextFieldHasSuffix: true,
|
|
|
|
|
suffixIcon: IconButton(
|
|
|
|
|
icon: Icon(
|
|
|
|
|
Icons.search,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
child: Stack(
|
|
|
|
|
children: [
|
|
|
|
|
AppTextFieldCustom(
|
|
|
|
|
hintText: TranslationBase.of(context).searchPatientName,
|
|
|
|
|
isTextFieldHasSuffix: true,
|
|
|
|
|
suffixIcon: IconButton(
|
|
|
|
|
icon: Icon(
|
|
|
|
|
Icons.search,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
),
|
|
|
|
|
onPressed: () {},
|
|
|
|
|
),
|
|
|
|
|
controller: _searchController,
|
|
|
|
|
onChanged: (value) {
|
|
|
|
|
model.filterSearchResults(value);
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
|
|
Positioned(
|
|
|
|
|
right: 35,
|
|
|
|
|
top:5,
|
|
|
|
|
child: IconButton(
|
|
|
|
|
icon: Icon(
|
|
|
|
|
isSortDes
|
|
|
|
|
? FontAwesomeIcons.sortAmountDown
|
|
|
|
|
: FontAwesomeIcons.sortAmountUp,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
),
|
|
|
|
|
iconSize: 20,
|
|
|
|
|
// padding: EdgeInsets.only(bottom: 30),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
model.sortInPatient(isDes: isSortDes);
|
|
|
|
|
isSortDes = !isSortDes;
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
onPressed: () {},
|
|
|
|
|
),
|
|
|
|
|
controller: _searchController,
|
|
|
|
|
onChanged: (value) {
|
|
|
|
|
model.filterSearchResults(value);
|
|
|
|
|
}),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
model.state == ViewState.Idle?model.filteredInPatientItems.length > 0
|
|
|
|
|
? Expanded(
|
|
|
|
|
|