move no data widget to separate file

merge-requests/829/head
Elham Rababh 5 years ago
parent a1f9729091
commit 37cd34f568

@ -0,0 +1,20 @@
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
import 'package:flutter/material.dart';
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)),
),
);
}
}

@ -14,6 +14,7 @@ import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import '../../../routes.dart'; import '../../../routes.dart';
import 'NoData.dart';
class InPatientListPage extends StatefulWidget { class InPatientListPage extends StatefulWidget {
final bool isMyInPatient; final bool isMyInPatient;
@ -90,6 +91,7 @@ class _InPatientListPageState extends State<InPatientListPage> {
onTap: () { onTap: () {
setState(() { setState(() {
isAllClinic = false; isAllClinic = false;
if(widget.patientSearchViewModel.myInpatientClinicList.length > 0)
showBottomSheet = true; showBottomSheet = true;
}); });
}, },
@ -102,7 +104,8 @@ class _InPatientListPageState extends State<InPatientListPage> {
setState(() { setState(() {
setState(() { setState(() {
isAllClinic = false; isAllClinic = false;
showBottomSheet = true; if(widget.patientSearchViewModel.myInpatientClinicList.length > 0)
showBottomSheet = true;
}); });
}); });
}, },
@ -320,7 +323,7 @@ class _InPatientListPageState extends State<InPatientListPage> {
height: 0, height: 0,
) )
: Container( : Container(
height: 500, height: MediaQuery.of(context).size.height * 0.5,
color: Colors.white, color: Colors.white,
child: ListView.builder( child: ListView.builder(
itemCount: widget itemCount: widget
@ -369,19 +372,4 @@ class _InPatientListPageState extends State<InPatientListPage> {
} }
} }
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)),
),
);
}
}

Loading…
Cancel
Save