import ' package:diplomaticquarterapp/core/viewModels/er/near_hospital_view_model.dart ' ;
import ' package:diplomaticquarterapp/pages/base/base_view.dart ' ;
import ' package:diplomaticquarterapp/uitl/location_util.dart ' ;
import ' package:diplomaticquarterapp/widgets/data_display/text.dart ' ;
import ' package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart ' ;
import ' package:diplomaticquarterapp/widgets/transitions/fade_page.dart ' ;
import ' package:flutter/cupertino.dart ' ;
import ' package:flutter/material.dart ' ;
import ' ../../uitl/translations_delegate_base.dart ' ;
import ' package:diplomaticquarterapp/pages/ErService/widgets/card_common.dart ' ;
import ' widgets/card_position.dart ' ;
class NearestEr extends StatelessWidget {
static const String url = " assets/images/ " ;
int appointmentNo ;
int projectID ;
NearestEr ( { this . appointmentNo , this . projectID } ) ;
@ override
Widget build ( BuildContext context ) {
return BaseView < NearHospitalViewModel > (
onModelReady: appointmentNo ! = null & & projectID ! = null
? ( model ) = > model . getProjectAvgERWaitingTimeOrders (
id: appointmentNo , projectID: projectID )
: ( model ) = > model . getProjectAvgERWaitingTimeOrders ( ) ,
builder: ( _ , mode , widget ) = > AppScaffold (
isShowAppBar: true ,
appBarTitle: ' Nearest ER ' ,
baseViewModel: mode ,
body: mode . ProjectAvgERWaitingTimeModeList . length > 0
? Container (
child: ListView (
children: < Widget > [
Text ( " \n This service Displays nearest branch \n among all the branches of All Habib \n medical Group based on your current Location " , textAlign: TextAlign . center ,
style: TextStyle (
fontSize: 18.0 ,
letterSpacing: 1.0 ,
fontWeight: FontWeight . w900 ,
color: new Color ( 0xFF60686b ) ) ) ,
Container (
margin: EdgeInsets . fromLTRB ( 0.0 , 10.0 , 0.0 , 10.0 ) ,
child: Column (
mainAxisAlignment: MainAxisAlignment . center ,
children: < Widget > [
Row (
mainAxisSize: MainAxisSize . min ,
mainAxisAlignment: MainAxisAlignment . center ,
children: < Widget > [
Expanded (
child: CardPosition (
text: mode . ProjectAvgERWaitingTimeModeList [ 0 ] . projectName . toString ( ) ,
image: ' assets/images/new-design/find_us_icon.png ' ,
subText: mode . ProjectAvgERWaitingTimeModeList [ 0 ] . distanceInKilometers . toString ( ) ,
type: mode . ProjectAvgERWaitingTimeModeList [ 0 ] . iD . toString ( ) ,
telephone: mode . ProjectAvgERWaitingTimeModeList [ 0 ] . phoneNumber . toString ( ) ,
networkImage: mode . ProjectAvgERWaitingTimeModeList [ 0 ] . projectImageURL . toString ( ) ,
latitude: mode . ProjectAvgERWaitingTimeModeList [ 0 ] . latitude ,
longitude: mode . ProjectAvgERWaitingTimeModeList [ 0 ] . longitude ,
projectname: mode . ProjectAvgERWaitingTimeModeList [ 0 ] . projectName ,
) ,
flex: 0 ,
) ,
Expanded (
child: CardPosition (
text: mode . ProjectAvgERWaitingTimeModeList [ 1 ] . projectName . toString ( ) ,
image: ' assets/images/new-design/find_us_icon.png ' ,
subText: mode . ProjectAvgERWaitingTimeModeList [ 1 ] . distanceInKilometers . toString ( ) ,
type: mode . ProjectAvgERWaitingTimeModeList [ 1 ] . iD . toString ( ) ,
telephone: mode . ProjectAvgERWaitingTimeModeList [ 1 ] . phoneNumber . toString ( ) ,
networkImage: mode . ProjectAvgERWaitingTimeModeList [ 1 ] . projectImageURL . toString ( ) ,
latitude: mode . ProjectAvgERWaitingTimeModeList [ 1 ] . latitude ,
longitude: mode . ProjectAvgERWaitingTimeModeList [ 1 ] . longitude ,
projectname: mode . ProjectAvgERWaitingTimeModeList [ 1 ] . projectName ,
) ,
flex: 0 ,
)
] ,
) ,
Row (
mainAxisSize: MainAxisSize . max ,
mainAxisAlignment: MainAxisAlignment . center ,
children: < Widget > [
Expanded (
child: CardPosition (
// mode
// .vitalSignResModelList[
// mode.vitalSignResModelList.length - 1]
// .heightCm
// .toString()
text: mode . ProjectAvgERWaitingTimeModeList [ 2 ] . projectName . toString ( ) ,
image: ' assets/images/new-design/find_us_icon.png ' ,
subText: mode . ProjectAvgERWaitingTimeModeList [ 2 ] . distanceInKilometers . toString ( ) ,
type: mode . ProjectAvgERWaitingTimeModeList [ 2 ] . iD . toString ( ) ,
telephone: mode . ProjectAvgERWaitingTimeModeList [ 2 ] . phoneNumber . toString ( ) ,
networkImage: mode . ProjectAvgERWaitingTimeModeList [ 2 ] . projectImageURL . toString ( ) ,
latitude: mode . ProjectAvgERWaitingTimeModeList [ 2 ] . latitude ,
longitude: mode . ProjectAvgERWaitingTimeModeList [ 2 ] . longitude ,
projectname: mode . ProjectAvgERWaitingTimeModeList [ 2 ] . projectName ,
) ,
flex: 0 ,
) ,
Expanded (
child: CardPosition (
// mode
// .vitalSignResModelList[
// mode.vitalSignResModelList.length - 1]
// .heightCm
// .toString()
text: mode . ProjectAvgERWaitingTimeModeList [ 3 ] . projectName . toString ( ) ,
image: ' assets/images/new-design/find_us_icon.png ' ,
subText: mode . ProjectAvgERWaitingTimeModeList [ 3 ] . distanceInKilometers . toString ( ) ,
type: mode . ProjectAvgERWaitingTimeModeList [ 3 ] . iD . toString ( ) ,
telephone: mode . ProjectAvgERWaitingTimeModeList [ 3 ] . phoneNumber . toString ( ) ,
networkImage: mode . ProjectAvgERWaitingTimeModeList [ 3 ] . projectImageURL . toString ( ) ,
latitude: mode . ProjectAvgERWaitingTimeModeList [ 3 ] . latitude ,
longitude: mode . ProjectAvgERWaitingTimeModeList [ 3 ] . longitude ,
projectname: mode . ProjectAvgERWaitingTimeModeList [ 3 ] . projectName ,
) ,
flex: 0 ,
)
] ,
) ,
Row (
mainAxisSize: MainAxisSize . max ,
mainAxisAlignment: MainAxisAlignment . center ,
children: < Widget > [
Expanded (
child: CardPosition (
// mode
// .vitalSignResModelList[
// mode.vitalSignResModelList.length - 1]
// .heightCm
// .toString()
text: mode . ProjectAvgERWaitingTimeModeList [ 4 ] . projectName . toString ( ) ,
image: ' assets/images/new-design/find_us_icon.png ' ,
subText: mode . ProjectAvgERWaitingTimeModeList [ 4 ] . distanceInKilometers . toString ( ) ,
type: mode . ProjectAvgERWaitingTimeModeList [ 4 ] . iD . toString ( ) ,
telephone: mode . ProjectAvgERWaitingTimeModeList [ 4 ] . phoneNumber . toString ( ) ,
networkImage: mode . ProjectAvgERWaitingTimeModeList [ 4 ] . projectImageURL . toString ( ) ,
latitude: mode . ProjectAvgERWaitingTimeModeList [ 4 ] . latitude ,
longitude: mode . ProjectAvgERWaitingTimeModeList [ 4 ] . longitude ,
projectname: mode . ProjectAvgERWaitingTimeModeList [ 4 ] . projectName ,
) ,
flex: 0 ,
) ,
Expanded (
child: CardPosition (
text: mode . ProjectAvgERWaitingTimeModeList [ 5 ] . projectName . toString ( ) ,
image: ' assets/images/new-design/find_us_icon.png ' ,
subText: mode . ProjectAvgERWaitingTimeModeList [ 5 ] . distanceInKilometers . toString ( ) ,
type: mode . ProjectAvgERWaitingTimeModeList [ 5 ] . iD . toString ( ) ,
telephone: mode . ProjectAvgERWaitingTimeModeList [ 5 ] . phoneNumber . toString ( ) ,
networkImage: mode . ProjectAvgERWaitingTimeModeList [ 5 ] . projectImageURL . toString ( ) ,
latitude: mode . ProjectAvgERWaitingTimeModeList [ 5 ] . latitude ,
longitude: mode . ProjectAvgERWaitingTimeModeList [ 5 ] . longitude ,
projectname: mode . ProjectAvgERWaitingTimeModeList [ 5 ] . projectName ,
) ,
flex: 0 ,
)
] ,
) ,
Row (
mainAxisSize: MainAxisSize . max ,
mainAxisAlignment: MainAxisAlignment . center ,
children: < Widget > [
Expanded (
child: CardPosition (
text: mode . ProjectAvgERWaitingTimeModeList [ 6 ] . projectName . toString ( ) ,
image: ' assets/images/new-design/find_us_icon.png ' ,
subText: mode . ProjectAvgERWaitingTimeModeList [ 6 ] . distanceInKilometers . toString ( ) ,
type: mode . ProjectAvgERWaitingTimeModeList [ 6 ] . iD . toString ( ) ,
telephone: mode . ProjectAvgERWaitingTimeModeList [ 6 ] . phoneNumber . toString ( ) ,
networkImage: mode . ProjectAvgERWaitingTimeModeList [ 6 ] . projectImageURL . toString ( ) ,
latitude: mode . ProjectAvgERWaitingTimeModeList [ 6 ] . latitude ,
longitude: mode . ProjectAvgERWaitingTimeModeList [ 6 ] . longitude ,
projectname: mode . ProjectAvgERWaitingTimeModeList [ 6 ] . projectName ,
) ,
flex: 0 ,
) ,
] ,
) ,
] ,
)
) ,
] ,
) ,
)
: Center (
child: Texts ( ' No Data ' ) ,
) ,
) ,
) ;
}
}
//class NearestEr extends StatefulWidget {
// static const String url = "assets/images/";
// final bool isAppbar;
//
//
// const NearestEr({Key key, this.isAppbar}) : super(key: key);
// @override
// _NearestErState createState() => _NearestErState();
//}
//
//class _NearestErState extends State<NearestEr> {
// LocationUtils locationUtils;
// @override
// void initState() {
// locationUtils =
// new LocationUtils(isShowConfirmDialog: true, context: context);
// WidgetsBinding.instance
// .addPostFrameCallback((_) => locationUtils.getCurrentLocation());
//
// super.initState();
// }
// @override
// Widget build(BuildContext context) {
// return AppScaffold(
// isShowAppBar: widget.isAppbar,
// appBarTitle: TranslationBase.of(context).bookAppo,
// body: Container(
// margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0),
// child: ListView(
//
// children: <Widget>[
// Text(TranslationBase.of(context).searchBy,
// style: TextStyle(
// fontSize: 24.0,
// letterSpacing: 1.0,
// fontWeight: FontWeight.bold,
// color: new Color(0xFF60686b))),
// Container(
// margin: EdgeInsets.fromLTRB(0.0, 10.0, 0.0, 10.0),
//
// child: Column(
// mainAxisAlignment: MainAxisAlignment.center,
// children: <Widget>[
// Row(
// mainAxisSize: MainAxisSize.min,
// mainAxisAlignment: MainAxisAlignment.center,
// children: <Widget>[
// Expanded(
// child: CardPosition(
// text: "Olaya Hospital",
// image: 'assets/images/new-design/find_us_icon.png',
//
// subText: TranslationBase.of(context).requestA,
// type: 3,
// ),
// flex: 0,
//
// ),
// Expanded(
// child: CardPosition(
// image: 'assets/images/new-design/find_us_icon.png',
// text: "Takhassusi Hospital",
// subText: TranslationBase.of(context).locationa,
// type: 5),
// flex: 0,
//
// )
// ],
// ),
// Row(
// mainAxisSize: MainAxisSize.max,
// mainAxisAlignment: MainAxisAlignment.center,
// children: <Widget>[
// Expanded(
// child: CardPosition(
// image: 'assets/images/new-design/find_us_icon.png',
// text: "Arryan Hospital",
// subText: TranslationBase.of(context).requestA,
// type: 4,
// ),
// flex: 0,
// ),
// Expanded(
// child: CardPosition(
// image: 'assets/images/new-design/find_us_icon.png',
// text: "Suwaidi Hospital",
// subText: TranslationBase.of(context).locationa,
// type: 6),
// flex: 0,
// )
// ],
// ),
// Row(
// mainAxisSize: MainAxisSize.max,
// mainAxisAlignment: MainAxisAlignment.center,
// children: <Widget>[
// Expanded(
// child: CardPosition(
// image: 'assets/images/new-design/find_us_icon.png',
// text: "Al Qassim Hospital",
// subText: TranslationBase.of(context).requestA,
// type: 7,
// ),
// flex: 0,
// ),
// Expanded(
// child: CardPosition(
// image: 'assets/images/new-design/find_us_icon.png',
// text: "Khobar Hospital",
// subText: TranslationBase.of(context).locationa,
// type: 8),
// flex: 0,
//
// )
// ],
// ),
// Row(
// mainAxisSize: MainAxisSize.max,
// mainAxisAlignment: MainAxisAlignment.center,
// children: <Widget>[
// Expanded(
// child: CardPosition(
// image: 'assets/images/new-design/find_us_icon.png',
// text: "Dubai Hospital",
// subText: TranslationBase.of(context).requestA,
// type: 1,
//
// ),
// flex: 0,
// ),
//
// ],
// ),
// ],
// )
// ),
// ],
// ),
// ),
// );
// }
//}