From 2c0cdff0dc1c13e510b640694e19df3ea42f553d Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Thu, 19 Aug 2021 10:37:00 +0300 Subject: [PATCH] remove loader from InPatientPage.dart --- lib/screens/patients/InPatientPage.dart | 32 ++++++++++++++++--------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/lib/screens/patients/InPatientPage.dart b/lib/screens/patients/InPatientPage.dart index 2a41414a..ffc3d03f 100644 --- a/lib/screens/patients/InPatientPage.dart +++ b/lib/screens/patients/InPatientPage.dart @@ -90,7 +90,7 @@ class _InPatientPageState extends State { ), ), widget.patientSearchViewModel.state == ViewState.Idle?widget.patientSearchViewModel.filteredInPatientItems.length > 0 - ? Expanded( + ? (widget.isMyInPatient && widget.patientSearchViewModel.myIinPatientList.length ==0 )?NoData():Expanded( child: Container( margin: EdgeInsets.symmetric(horizontal: 16.0), child: SingleChildScrollView( @@ -175,19 +175,11 @@ class _InPatientPageState extends State { ), ), ) - : Expanded( - child: SingleChildScrollView( - child: Container( - child: ErrorMessage( - error: - TranslationBase.of(context).noDataAvailable)), - ), - ): Center( + : NoData(): Center( child: Container( height: 300, width: 300, - child: Image.asset( - "assets/images/progress-loading-red.gif"), + ), ), ], @@ -195,3 +187,21 @@ class _InPatientPageState extends State { ); } } + +class NoData extends StatelessWidget { + const NoData({ + Key key, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return Expanded( + child: SingleChildScrollView( + child: Container( + child: ErrorMessage( + error: + TranslationBase.of(context).noDataAvailable)), + ), + ); + } +}