You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
HMG_Patient_App/lib/pages/ErService/NearestEr.dart

340 lines
14 KiB
Dart

5 years ago
import 'package:diplomaticquarterapp/core/viewModels/er/near_hospital_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
5 years ago
import 'package:diplomaticquarterapp/uitl/location_util.dart';
5 years ago
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
5 years ago
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
5 years ago
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
5 years ago
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';
5 years ago
import 'widgets/card_position.dart';
5 years ago
5 years ago
class NearestEr extends StatelessWidget {
5 years ago
5 years ago
static const String url = "assets/images/";
5 years ago
5 years ago
int appointmentNo;
int projectID;
NearestEr({this.appointmentNo, this.projectID});
5 years ago
@override
Widget build(BuildContext context) {
5 years ago
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(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(
5 years ago
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
5 years ago
Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Expanded(
child: CardPosition(
text: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].projectName,
image: 'assets/images/new-design/find_us_icon.png',
subText: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].distanceInKilometers,
type: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].iD,
),
flex: 0,
),
Expanded(
child: CardPosition(
// mode
// .vitalSignResModelList[
// mode.vitalSignResModelList.length - 1]
// .heightCm
// .toString()
text: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].projectName,
image: 'assets/images/new-design/find_us_icon.png',
subText: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].distanceInKilometers,
type: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].iD,
),
flex: 0,
)
],
5 years ago
),
5 years ago
Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Expanded(
child: CardPosition(
// mode
// .vitalSignResModelList[
// mode.vitalSignResModelList.length - 1]
// .heightCm
// .toString()
text: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].projectName,
image: 'assets/images/new-design/find_us_icon.png',
subText: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].distanceInKilometers,
type: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].iD,
),
flex: 0,
),
Expanded(
child: CardPosition(
// mode
// .vitalSignResModelList[
// mode.vitalSignResModelList.length - 1]
// .heightCm
// .toString()
text: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].projectName,
image: 'assets/images/new-design/find_us_icon.png',
subText: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].distanceInKilometers,
type: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].iD,
),
flex: 0,
)
],
5 years ago
),
5 years ago
Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Expanded(
child: CardPosition(
// mode
// .vitalSignResModelList[
// mode.vitalSignResModelList.length - 1]
// .heightCm
// .toString()
text: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].projectName,
image: 'assets/images/new-design/find_us_icon.png',
subText: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].distanceInKilometers,
type: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].iD,
),
flex: 0,
),
Expanded(
child: CardPosition(
// mode
// .vitalSignResModelList[
// mode.vitalSignResModelList.length - 1]
// .heightCm
// .toString()
text: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].projectName,
image: 'assets/images/new-design/find_us_icon.png',
subText: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].distanceInKilometers,
type: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].iD,
),
flex: 0,
)
],
5 years ago
),
5 years ago
Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Expanded(
child: CardPosition(
text: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].projectName,
image: 'assets/images/new-design/find_us_icon.png',
5 years ago
5 years ago
subText: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].distanceInKilometers.toString(),
type: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].iD.toString(),
),
flex: 0,
),
],
),
5 years ago
],
5 years ago
)
),
],
),
)
: Center(
child: Texts('No Data'),
5 years ago
),
),
);
}
}
5 years ago
//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,
// ),
//
// ],
// ),
// ],
// )
// ),
// ],
// ),
// ),
// );
// }
//}