merger DQ live and fix some issues on Child Vaccines
parent
a556e8c1f8
commit
fa01d132c7
@ -0,0 +1,111 @@
|
|||||||
|
import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/childvaccines/delete_baby_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/child_vaccines_view_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/ChildVaccines/vaccinationtable_page.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class ChildDetailsWidget extends StatelessWidget {
|
||||||
|
final ChildVaccinesViewModel model;
|
||||||
|
final List_BabyInformationModel babyInfo;
|
||||||
|
DeleteBaby deleteBaby = DeleteBaby();
|
||||||
|
|
||||||
|
ChildDetailsWidget({this.model, this.babyInfo});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
margin: EdgeInsets.only(left: 5, right: 5, bottom: 10),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
shape: BoxShape.rectangle,
|
||||||
|
border: Border.all(color: Colors.white, width: 0.5),
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(5)),
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
padding: EdgeInsets.all(12),
|
||||||
|
width: 200,
|
||||||
|
//double.infinity,
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Row(children: [
|
||||||
|
Texts("CHILD NAME"),
|
||||||
|
]),
|
||||||
|
Row(children: [
|
||||||
|
Texts(babyInfo.babyName.trim()),
|
||||||
|
]),
|
||||||
|
Row(children: [
|
||||||
|
IconButton(
|
||||||
|
icon: Image.asset(babyInfo.gender == 1
|
||||||
|
? 'assets/images/new-design/male.png'
|
||||||
|
: 'assets/images/new-design/female.png'),
|
||||||
|
tooltip: '',
|
||||||
|
onPressed: () {
|
||||||
|
// setState(() {
|
||||||
|
// // _volume += 10;
|
||||||
|
// // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber);
|
||||||
|
// });
|
||||||
|
},
|
||||||
|
),
|
||||||
|
Texts(babyInfo.genderDescription),
|
||||||
|
IconButton(
|
||||||
|
icon: Icon(
|
||||||
|
Icons.remove_red_eye,
|
||||||
|
color: Colors.red,
|
||||||
|
),
|
||||||
|
tooltip: '',
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
FadePage(
|
||||||
|
page: VaccinationTablePage(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
)
|
||||||
|
]),
|
||||||
|
Row(children: [
|
||||||
|
Texts("Birthday"),
|
||||||
|
]),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
IconButton(
|
||||||
|
icon: new Image.asset(
|
||||||
|
'assets/images/new-design/calender-secondary.png'),
|
||||||
|
tooltip: '',
|
||||||
|
),
|
||||||
|
Texts(
|
||||||
|
DateUtil.yearMonthDay(babyInfo.dOB),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(children: [
|
||||||
|
IconButton(
|
||||||
|
icon: new Image.asset('assets/images/new-design/garbage.png'),
|
||||||
|
tooltip: '',
|
||||||
|
onPressed: () async {
|
||||||
|
await model.deleteBabyOrders(newChild: deleteBaby);
|
||||||
|
deleteBaby.babyID = babyInfo.babyID;
|
||||||
|
|
||||||
|
await model.deleteBabyOrders(newChild: deleteBaby);
|
||||||
|
if (model.isDeleted) {
|
||||||
|
AppToast.showSuccessToast(message: "Record Deleted");
|
||||||
|
Navigator.pop(context, model.isDeleted);
|
||||||
|
} else {
|
||||||
|
//TODO handling error
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
Texts("Delete"),
|
||||||
|
]),
|
||||||
|
SizedBox(
|
||||||
|
height: 12,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue