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.
121 lines
4.0 KiB
Dart
121 lines
4.0 KiB
Dart
import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart';
|
|
import 'package:diplomaticquarterapp/core/model/childvaccines/delete_baby_model.dart';
|
|
import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_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/uitl/translations_delegate_base.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';
|
|
import 'package:flutter_flexible_toast/flutter_flexible_toast.dart';
|
|
|
|
import 'dialogs/delete_child.dart';
|
|
|
|
class ChildDetailsWidget extends StatelessWidget {
|
|
final ChildVaccinesViewModel model;
|
|
final List_BabyInformationModel babyInfo;
|
|
final List_UserInformationModel informationModel;
|
|
final Function onTapDelete;
|
|
|
|
ChildDetailsWidget({this.model, this.babyInfo, this.informationModel, this.onTapDelete});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return InkWell(
|
|
onTap: (){
|
|
Navigator.push(
|
|
context,
|
|
FadePage(
|
|
page: VaccinationTablePage(
|
|
babyInfo: babyInfo,
|
|
informationModel: informationModel,
|
|
),
|
|
),
|
|
);
|
|
},
|
|
child: 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(TranslationBase.of(context).childName),
|
|
]),
|
|
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: () {
|
|
},
|
|
),
|
|
Texts(babyInfo.genderDescription),
|
|
IconButton(
|
|
icon: Icon(
|
|
Icons.remove_red_eye,
|
|
color: Colors.red,
|
|
),
|
|
tooltip: '',
|
|
onPressed: () {
|
|
Navigator.push(
|
|
context,
|
|
FadePage(
|
|
page: VaccinationTablePage(
|
|
babyInfo: babyInfo,
|
|
informationModel: informationModel,
|
|
),
|
|
),
|
|
);
|
|
},
|
|
)
|
|
]),
|
|
Row(children: [
|
|
Texts(TranslationBase.of(context).childDob),
|
|
]),
|
|
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 {
|
|
onTapDelete();
|
|
},
|
|
),
|
|
Texts(TranslationBase.of(context).delete),
|
|
]),
|
|
SizedBox(
|
|
height: 12,
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|