Add Translation to prescription pages
parent
f266f54be0
commit
34f658a166
@ -0,0 +1,157 @@
|
||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart';
|
||||
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../../core/viewModel/prescriptions_view_model.dart';
|
||||
import '../../../widgets/shared/dialogs/ShowImageDialog.dart';
|
||||
|
||||
|
||||
class PrescriptionItemsWidget extends StatelessWidget {
|
||||
final String itemDescription;
|
||||
final String route;
|
||||
final String frequency;
|
||||
final int dailyDoses;
|
||||
final String imageSRCUrl;
|
||||
final String remarks;
|
||||
final int days;
|
||||
final PrescriptionsViewModel prescriptionsViewModel;
|
||||
|
||||
|
||||
|
||||
PrescriptionItemsWidget(
|
||||
{this.itemDescription,
|
||||
this.route,
|
||||
this.frequency,
|
||||
this.dailyDoses,
|
||||
this.imageSRCUrl,
|
||||
this.remarks,
|
||||
this.days,
|
||||
this.prescriptionsViewModel});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
children: [
|
||||
...List.generate(
|
||||
// TODO Elham* List.generate to list.builder
|
||||
prescriptionsViewModel.prescriptionReportEnhList.length,
|
||||
(index) => Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
color: Colors.white,
|
||||
),
|
||||
margin: EdgeInsets.all(12),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 18, right: 18),
|
||||
child: AppText(
|
||||
prescriptionsViewModel.prescriptionReportEnhList[index].itemDescription,
|
||||
bold: true,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 18,
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
border: Border.all(
|
||||
width: 0.5, color: Colors.grey)),
|
||||
height: 55,
|
||||
width: 55,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (ctx) => ShowImageDialog(
|
||||
imageUrl: prescriptionsViewModel.prescriptionReportEnhList[index].imageSRCUrl,
|
||||
));
|
||||
},
|
||||
child: Stack(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Image.network(
|
||||
prescriptionsViewModel.prescriptionReportEnhList[index].imageSRCUrl,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 10,
|
||||
right: 10,
|
||||
child: Icon(
|
||||
EvaIcons.search,
|
||||
color: Colors.grey,
|
||||
size: 35,
|
||||
))
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
CustomRow(
|
||||
label: TranslationBase.of(context).route + ' : ',
|
||||
value: " " + prescriptionsViewModel.prescriptionReportEnhList[index].route ?? '',
|
||||
labelSize: 13,
|
||||
valueSize: 13,
|
||||
),
|
||||
CustomRow(
|
||||
label: TranslationBase.of(context).frequency + ' : ',
|
||||
value: " " + prescriptionsViewModel.prescriptionReportEnhList[index].frequency ?? '',
|
||||
labelSize: 13,
|
||||
valueSize: 13,
|
||||
),
|
||||
CustomRow(
|
||||
label: TranslationBase.of(context).dailyDoses + ' : ',
|
||||
value: " " + prescriptionsViewModel.prescriptionReportEnhList[index].doseDailyQuantity.toString() ?? '',
|
||||
labelSize: 13,
|
||||
valueSize: 13,
|
||||
),
|
||||
CustomRow(
|
||||
label: TranslationBase.of(context).duration + ' : ',
|
||||
value: " " + prescriptionsViewModel.prescriptionReportList[index].days.toString() ?? '',
|
||||
labelSize: 13,
|
||||
valueSize: 13,
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
CustomRow(
|
||||
label: '',
|
||||
value: prescriptionsViewModel.prescriptionReportList[index].remarks ?? '',
|
||||
valueSize: 14,
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue