move no data widget to separate file

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