From 1d29aa36a2f3f48a18ba0cff506e1b41ee0abc5b Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Wed, 7 Oct 2020 10:39:42 +0300 Subject: [PATCH] child Vaccines --- lib/config/config.dart | 4 + .../create_vaccination_table.dart | 25 ++ .../childvaccines/child_vaccines_service.dart | 9 +- .../user_information_service.dart | 13 +- .../vaccination_table_service.dart | 39 +++ .../vaccination_table_view_model.dart | 30 +++ lib/locator.dart | 7 +- .../ChildVaccines/add_newchild_page.dart | 10 +- lib/pages/ChildVaccines/child_page.dart | 34 ++- .../ChildVaccines/child_vaccines_page.dart | 1 + .../dialogs/SelectGenderDialog.dart | 146 +++++++++++ lib/pages/ChildVaccines/new_text_Field.dart | 239 ------------------ .../ChildVaccines/vaccinationtable_page.dart | 136 ++++++++++ 13 files changed, 435 insertions(+), 258 deletions(-) create mode 100644 lib/core/model/childvaccines/create_vaccination_table.dart create mode 100644 lib/core/service/childvaccines/vaccination_table_service.dart create mode 100644 lib/core/viewModels/child_vaccines/vaccination_table_view_model.dart create mode 100644 lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart delete mode 100644 lib/pages/ChildVaccines/new_text_Field.dart create mode 100644 lib/pages/ChildVaccines/vaccinationtable_page.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 65f1553e..2f497de2 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -83,6 +83,10 @@ const GET_NEWCHILD_REQUEST= 'Services/Community.svc/REST/CreateNewBaby'; +///addNewTABLE +const GET_TABLE_REQUEST= + 'Services/Community.svc/REST/CreateVaccinationTable'; + ///BloodDenote diff --git a/lib/core/model/childvaccines/create_vaccination_table.dart b/lib/core/model/childvaccines/create_vaccination_table.dart new file mode 100644 index 00000000..d39f2a64 --- /dev/null +++ b/lib/core/model/childvaccines/create_vaccination_table.dart @@ -0,0 +1,25 @@ +class CreateVaccinationTable { + String givenAt; + String status; + String vaccinesDescription; + String visit; + + CreateVaccinationTable( + {this.givenAt, this.status, this.vaccinesDescription, this.visit}); + + CreateVaccinationTable.fromJson(Map json) { + givenAt = json['GivenAt']; + status = json['Status']; + vaccinesDescription = json['VaccinesDescription']; + visit = json['Visit']; + } + + Map toJson() { + final Map data = new Map(); + data['GivenAt'] = this.givenAt; + data['Status'] = this.status; + data['VaccinesDescription'] = this.vaccinesDescription; + data['Visit'] = this.visit; + return data; + } +} \ No newline at end of file diff --git a/lib/core/service/childvaccines/child_vaccines_service.dart b/lib/core/service/childvaccines/child_vaccines_service.dart index 097f6bb0..75a07338 100644 --- a/lib/core/service/childvaccines/child_vaccines_service.dart +++ b/lib/core/service/childvaccines/child_vaccines_service.dart @@ -1,3 +1,5 @@ +import 'dart:convert'; + import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart'; import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart'; @@ -6,13 +8,16 @@ import '../base_service.dart'; class ChildVaccinesService extends BaseService { List babyInformationModelList = List(); List userInformationModelList = List(); + Map body = Map(); Future getAllBabyInformationOrders() async { hasError = false; + body['isDentalAllowedBackend'] = false; body['IsLogin'] = true; - // body['UserID'] = babyInformationModelList[0].userID; - body['UserID'] = 42843; + + //body['UserID'] = userInformationModelList[0].userID;//AuthenticatedUser.fromJson(json['List'][0] //babyInformationModelList[0].userID; + body['UserID'] = 46013;//42843; await baseAppClient.post(GET_BABYINFORMATION_REQUEST, diff --git a/lib/core/service/childvaccines/user_information_service.dart b/lib/core/service/childvaccines/user_information_service.dart index 9082039f..7651ef0f 100644 --- a/lib/core/service/childvaccines/user_information_service.dart +++ b/lib/core/service/childvaccines/user_information_service.dart @@ -12,9 +12,16 @@ class UserInformationService extends BaseService{ Future getUserInformationOrders() async { hasError = false; - // body['isDentalAllowedBackend'] = false; - // body['IsLogin'] = true; - // body['UserID'] = 42843; + await getUser(); + body['CreatedBy'] = 102; + body['EditedBy'] = 102; + body['EmailAddress'] = user.emailAddress; + body['IsLogin'] =true; + body['LogInTokenID'] = 'ZBGoQFUG50eQJd6Y7u1ykA=='; + body['MobileNumber'] = user.mobileNumber; + body['NationalID'] = user.nationalityID; + body['ZipCode'] = user.zipCode; + body['isDentalAllowedBackend'] = false; await baseAppClient.post(GET_USERINFORMATION_REQUEST, diff --git a/lib/core/service/childvaccines/vaccination_table_service.dart b/lib/core/service/childvaccines/vaccination_table_service.dart new file mode 100644 index 00000000..7f987b76 --- /dev/null +++ b/lib/core/service/childvaccines/vaccination_table_service.dart @@ -0,0 +1,39 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/create_vaccination_table.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart'; +import '../base_service.dart'; + +class VaccinationTableService extends BaseService { + List createVaccinationTableModelList = List(); + Map body = Map(); + + + + Future getCreateVaccinationTableOrders() async { + hasError = false; + await getUser(); + body['BabyName']="fffffffffff eeeeeeeeeeeeee"; + body['DOB'] = "/Date(1585774800000+0300)/"; + body['EmailAddress'] = user.emailAddress; + body['isDentalAllowedBackend'] = false; + body['SendEmail'] = false; + body['IsLogin'] =true; + + + + + await baseAppClient.post(GET_TABLE_REQUEST, + onSuccess: (dynamic response, int statusCode) { + createVaccinationTableModelList.clear(); + response['List_CreateVaccinationTableModel'].forEach((vital) { + createVaccinationTableModelList.add( + CreateVaccinationTable.fromJson(vital)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + +} \ No newline at end of file diff --git a/lib/core/viewModels/child_vaccines/vaccination_table_view_model.dart b/lib/core/viewModels/child_vaccines/vaccination_table_view_model.dart new file mode 100644 index 00000000..3b72dd50 --- /dev/null +++ b/lib/core/viewModels/child_vaccines/vaccination_table_view_model.dart @@ -0,0 +1,30 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/create_vaccination_table.dart'; +import 'package:diplomaticquarterapp/core/service/childvaccines/add_new_child_service.dart'; +import 'package:diplomaticquarterapp/core/service/childvaccines/vaccination_table_service.dart'; + +import '../../../locator.dart'; +import '../base_view_model.dart'; + + +class VaccinationTableViewModel extends BaseViewModel{ + + VaccinationTableService _creteVaccinationTableService = locator(); + + // String get creteVaccinationTableContent => _creteVaccinationTableService.userAgreementContent; + //String get userAgreementContent => _creteNewBabyService.v//_reportsService.userAgreementContent; + List get creteVaccinationTableModelList=> _creteVaccinationTableService.createVaccinationTableModelList;//.createNewBabyModelList; + getCreateVaccinationTable() async { + setState(ViewState.Busy); + + await _creteVaccinationTableService.getCreateVaccinationTableOrders();//getCreateNewBabyOrders(); + + if ( _creteVaccinationTableService.hasError) { + error = _creteVaccinationTableService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + +} diff --git a/lib/locator.dart b/lib/locator.dart index dee65ccc..46b97fce 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -14,6 +14,7 @@ import 'core/service/blood/blood_donation_service.dart'; import 'core/service/childvaccines/add_new_child_service.dart'; import 'core/service/childvaccines/child_vaccines_service.dart'; import 'core/service/childvaccines/user_information_service.dart'; +import 'core/service/childvaccines/vaccination_table_service.dart'; import 'core/service/contactus/finadus_service.dart'; import 'core/service/contactus/livechat_service.dart'; import 'core/service/dashboard_service.dart'; @@ -43,6 +44,7 @@ import 'core/viewModels/blooddonation/blood_details_view_model.dart'; import 'core/viewModels/blooddonation/booddonation_view_model.dart'; import 'core/viewModels/child_vaccines/add_new_child_view_model.dart'; import 'core/viewModels/child_vaccines/child_vaccines_view_model.dart'; +import 'core/viewModels/child_vaccines/vaccination_table_view_model.dart'; import 'core/viewModels/contactus/findus_view_model.dart'; import 'core/viewModels/contactus/livechat_view_model.dart'; import 'core/viewModels/er/am_request_view_model.dart'; @@ -121,6 +123,7 @@ void setupLocator() { locator.registerLazySingleton(() => ChildVaccinesService()); locator.registerLazySingleton(() => UserInformationService()); locator.registerLazySingleton(() => CreteNewBabyService()); + locator.registerLazySingleton(() => VaccinationTableService()); /// View Model @@ -151,7 +154,9 @@ void setupLocator() { locator.registerFactory(() => BloodDeatailsViewModel()); locator.registerFactory(() => ChildVaccinesViewModel()); locator.registerFactory(() => UserInformationViewModel()); - locator.registerFactory(() => UserInformationViewModel()); + locator.registerFactory(() => VaccinationTableViewModel()); + + locator.registerFactory(() => AddNewChildViewModel()); locator.registerFactory(() => H2OViewModel()); diff --git a/lib/pages/ChildVaccines/add_newchild_page.dart b/lib/pages/ChildVaccines/add_newchild_page.dart index f4f2db94..a24fa5a4 100644 --- a/lib/pages/ChildVaccines/add_newchild_page.dart +++ b/lib/pages/ChildVaccines/add_newchild_page.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/add_new_child_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/child_vaccines_view_model.dart'; +import 'package:diplomaticquarterapp/pages/Blood/new_text_Field.dart'; import 'package:diplomaticquarterapp/pages/ChildVaccines/add_newchild_page.dart'; import 'package:diplomaticquarterapp/pages/ChildVaccines/child_page.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; @@ -18,7 +19,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; -import 'new_text_Field.dart'; + enum Gender { Male, Female, NON } enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON } @@ -260,12 +261,15 @@ class _AddNewChildPageState extends State { _firstTextController.text + " " + _secondTextController.text; newChild.gender = checkedValue.toString(); newChild.strDOB=getStartDay() ; + newChild.alertBy=addvancedModel.alertBy; newChild.createdBy=informationModel.createdBy ; newChild.editedBy=informationModel.createdBy; newChild.tempValue=true; - newChild.userID=addvancedModel.userID; + // newChild.userID=46013;//informationModel.userID; newChild.isLogin=true; - newChild.alertBy=addvancedModel.alertBy; + //newChild.tokenID='qMgbP94U23RkXtWWT0Sw=='; + //'ZBGoQFUG50eQJd6Y7u1ykA=='; + model.getNewBabyOrders(newChild: newChild); diff --git a/lib/pages/ChildVaccines/child_page.dart b/lib/pages/ChildVaccines/child_page.dart index 54e2b60d..c657b3ca 100644 --- a/lib/pages/ChildVaccines/child_page.dart +++ b/lib/pages/ChildVaccines/child_page.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/child_vaccines_view_model.dart'; import 'package:diplomaticquarterapp/pages/ChildVaccines/add_newchild_page.dart'; +import 'package:diplomaticquarterapp/pages/ChildVaccines/vaccinationtable_page.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; @@ -43,17 +44,18 @@ class _ChildPageState extends State with SingleTickerProviderStateMix color: Colors.white, ), - width: 150, + padding: EdgeInsets.all(12), + width: double.infinity, child: Column( children: [ Row(children:[Texts("CHILD NAME"),]), - Row(children:[Texts(model.babyInformationModelList[index].babyName),]), + Row(children:[Texts(model.babyInformationModelList[index].babyName.trim()),]), Row( children: [IconButton( - icon: new Image.asset('assets/images/new-design/female.png'), - tooltip: 'Increase volume by 10', + icon: Image.asset(model.babyInformationModelList[index].gender==1? 'assets/images/new-design/male.png':'assets/images/new-design/female.png'), + tooltip: '', onPressed: () { setState(() { // _volume += 10; @@ -61,15 +63,27 @@ class _ChildPageState extends State with SingleTickerProviderStateMix }); }, ), - Texts(model.babyInformationModelList[index].babyName), + Texts(model.babyInformationModelList[index].genderDescription), IconButton( - icon: Icon(Icons.remove_red_eye_outlined,color: Colors.red,), + icon: Icon(Icons.remove_red_eye,color: Colors.red,), tooltip: 'Increase volume by 10', onPressed: () { - setState(() { - // _volume += 10; - // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); - }); + Navigator.push( + context, + FadePage( + page: VaccinationTablePage(), + + //ChildPage(babyInformationModelList:model.BabyInformationModelList) + // HospitalsPage( + // findusHospitalModelList: model.FindusHospitalModelList, + // ) + + ), + ); + // setState(() { + // // _volume += 10; + // // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); + // }); }, )] ), diff --git a/lib/pages/ChildVaccines/child_vaccines_page.dart b/lib/pages/ChildVaccines/child_vaccines_page.dart index 269c9259..ba4589a9 100644 --- a/lib/pages/ChildVaccines/child_vaccines_page.dart +++ b/lib/pages/ChildVaccines/child_vaccines_page.dart @@ -32,6 +32,7 @@ class _ChildVaccinesPageState extends State onModelReady: (model) => model.getUserInformatioRequestOrders(), builder: (_, model, w) => AppScaffold( isShowAppBar: true, + baseViewModel: model, appBarTitle: " Vaccination",//TranslationBase.of(context).advancePayment, body: SingleChildScrollView( physics: ScrollPhysics(), diff --git a/lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart b/lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart new file mode 100644 index 00000000..295c6dcd --- /dev/null +++ b/lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart @@ -0,0 +1,146 @@ +import 'package:diplomaticquarterapp/pages/Blood/blood_donation.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class SelectGenderDialog extends StatefulWidget { + final Gender beneficiaryType; + final Function(Gender) onValueSelected; + + SelectGenderDialog({Key key, this.beneficiaryType, this.onValueSelected}); + + @override + _SelectGenderDialogState createState() => + _SelectGenderDialogState(this.beneficiaryType); +} + +class _SelectGenderDialogState extends State { + _SelectGenderDialogState(this.beneficiaryType); + Gender beneficiaryType; + + @override + Widget build(BuildContext context) { + return SimpleDialog( + children: [ + Container( + child: Column( + children: [ + Divider(), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + beneficiaryType = Gender.Male; + }); + }, + child: ListTile( + title: Text("Male"), + leading: Radio( + value: Gender.Male, + groupValue: beneficiaryType, + activeColor: Colors.red[800], + onChanged: (Gender value) { + setState(() { + beneficiaryType = value; + }); + }, + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + beneficiaryType = Gender.Female; + }); + }, + child: ListTile( + title: Text("Female"), + leading: Radio( + value: Gender.Female, + groupValue: beneficiaryType, + activeColor: Colors.red[800], + onChanged: (Gender value) { + setState(() { + beneficiaryType = value; + }); + }, + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + SizedBox( + height: 5.0, + ), + Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Center( + child: Texts( + TranslationBase.of(context).cancel.toUpperCase(), + color: Colors.red, + ), + ), + ), + ), + ), + ), + Container( + width: 1, + height: 30, + color: Colors.grey[500], + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + widget.onValueSelected(beneficiaryType); + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts( + TranslationBase.of(context).ok, + fontWeight: FontWeight.w400, + ), + ), + ), + ), + ), + ], + ) + ], + ), + ) + ], + ); + } +} diff --git a/lib/pages/ChildVaccines/new_text_Field.dart b/lib/pages/ChildVaccines/new_text_Field.dart deleted file mode 100644 index ad9eb580..00000000 --- a/lib/pages/ChildVaccines/new_text_Field.dart +++ /dev/null @@ -1,239 +0,0 @@ -import 'package:eva_icons_flutter/eva_icons_flutter.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; - -class NumberTextInputFormatter extends TextInputFormatter { - @override - TextEditingValue formatEditUpdate( - TextEditingValue oldValue, TextEditingValue newValue) { - final int newTextLength = newValue.text.length; - int selectionIndex = newValue.selection.end; - int usedSubstringIndex = 0; - final StringBuffer newText = StringBuffer(); - if (newTextLength >= 1) { - newText.write('('); - if (newValue.selection.end >= 1) selectionIndex++; - } - if (newTextLength >= 4) { - newText.write(newValue.text.substring(0, usedSubstringIndex = 3) + ') '); - if (newValue.selection.end >= 3) selectionIndex += 2; - } - if (newTextLength >= 7) { - newText.write(newValue.text.substring(3, usedSubstringIndex = 6) + '-'); - if (newValue.selection.end >= 6) selectionIndex++; - } - if (newTextLength >= 11) { - newText.write(newValue.text.substring(6, usedSubstringIndex = 10) + ' '); - if (newValue.selection.end >= 10) selectionIndex++; - } - // Dump the rest. - if (newTextLength >= usedSubstringIndex) - newText.write(newValue.text.substring(usedSubstringIndex)); - return TextEditingValue( - text: newText.toString(), - selection: TextSelection.collapsed(offset: selectionIndex), - ); - } -} - -final _mobileFormatter = NumberTextInputFormatter(); - -class NewTextFields extends StatefulWidget { - NewTextFields( - {Key key, - this.type, - this.hintText, - this.suffixIcon, - this.autoFocus, - this.onChanged, - this.initialValue, - this.minLines, - this.maxLines, - this.inputFormatters, - this.padding, - this.focus = false, - this.maxLengthEnforced = true, - this.suffixIconColor, - this.inputAction, - this.onSubmit, - this.keepPadding = true, - this.textCapitalization = TextCapitalization.none, - this.controller, - this.keyboardType, - this.validator, - this.borderOnlyError = false, - this.onSaved, - this.onSuffixTap, - this.readOnly: false, - this.maxLength, - this.prefixIcon, - this.bare = false, - this.onTap, - this.fontSize = 16.0, - this.fontWeight = FontWeight.w700, - this.autoValidate = false, - this.hintColor,this.isEnabled=true}) - : super(key: key); - - final String hintText; - - // final String initialValue; - final String type; - final bool autoFocus; - final IconData suffixIcon; - final Color suffixIconColor; - final Icon prefixIcon; - final VoidCallback onTap; - final TextEditingController controller; - final TextInputType keyboardType; - final FormFieldValidator validator; - final Function onSaved; - final Function onSuffixTap; - final Function onChanged; - final Function onSubmit; - final bool readOnly; - final int maxLength; - final int minLines; - final int maxLines; - final bool maxLengthEnforced; - final bool bare; - final bool isEnabled; - final TextInputAction inputAction; - final double fontSize; - final FontWeight fontWeight; - final bool keepPadding; - final TextCapitalization textCapitalization; - final List inputFormatters; - final bool autoValidate; - final EdgeInsets padding; - final bool focus; - final bool borderOnlyError; - final Color hintColor; - final String initialValue; - @override - _NewTextFieldsState createState() => _NewTextFieldsState(); -} - -class _NewTextFieldsState extends State { - final FocusNode _focusNode = FocusNode(); - bool focus = false; - bool view = false; - - @override - void initState() { - super.initState(); - _focusNode.addListener(() { - setState(() { - focus = _focusNode.hasFocus; - }); - }); - } - - @override - void didUpdateWidget(NewTextFields oldWidget) { - if (widget.focus) _focusNode.requestFocus(); - super.didUpdateWidget(oldWidget); - } - - @override - void dispose() { - _focusNode.dispose(); - super.dispose(); - } - - - bool _determineReadOnly() { - if (widget.readOnly != null && widget.readOnly) { - _focusNode.unfocus(); - return true; - } else { - return false; - } - } - - @override - Widget build(BuildContext context) { - return AnimatedContainer( - duration: Duration(milliseconds: 300), - decoration:BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Container( - margin: EdgeInsets.only(top: 8), - - child: TextFormField( - enabled: widget.isEnabled, - initialValue: widget.initialValue, - keyboardAppearance: Theme.of(context).brightness, - scrollPhysics: BouncingScrollPhysics(), - autovalidate: widget.autoValidate, - textCapitalization: widget.textCapitalization, - onFieldSubmitted: widget.inputAction == TextInputAction.next - ? (widget.onSubmit != null - ? widget.onSubmit - : (val) { - _focusNode.nextFocus(); - }) - : widget.onSubmit, - textInputAction: widget.inputAction, - minLines: widget.minLines ?? 1, - maxLines: widget.maxLines ?? 1, - maxLengthEnforced: widget.maxLengthEnforced, - onChanged: widget.onChanged, - focusNode: _focusNode, - maxLength: widget.maxLength ?? null, - controller: widget.controller, - keyboardType: widget.keyboardType, - readOnly: _determineReadOnly(), - obscureText: widget.type == "password" && !view ? true : false, - autofocus: widget.autoFocus ?? false, - validator: widget.validator, - onSaved: widget.onSaved, - - style: Theme.of(context) - .textTheme - .body2 - .copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight), - inputFormatters: widget.keyboardType == TextInputType.phone - ? [ - WhitelistingTextInputFormatter.digitsOnly, - _mobileFormatter, - ] - : widget.inputFormatters, - decoration: InputDecoration( - labelText: widget.hintText, - labelStyle: TextStyle(color: Colors.black), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: Theme.of(context) - .errorColor - .withOpacity(0.5), - width: 1.0), - borderRadius: BorderRadius.circular(12.0)), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: Theme.of(context) - .errorColor - .withOpacity(0.5), - width: 1.0), - borderRadius: BorderRadius.circular(8.0)), - focusedBorder: OutlineInputBorder( - borderSide: - BorderSide(color: Colors.white, width: 1.0), - borderRadius: BorderRadius.circular(12)), - disabledBorder: OutlineInputBorder( - borderSide: - BorderSide(color: Colors.white, width: 1.0), - borderRadius: BorderRadius.circular(12)), - enabledBorder: OutlineInputBorder( - borderSide: - BorderSide(color: Colors.white, width: 1.0), - borderRadius: BorderRadius.circular(12), - ), - ), - ), - ), - ); - } -} diff --git a/lib/pages/ChildVaccines/vaccinationtable_page.dart b/lib/pages/ChildVaccines/vaccinationtable_page.dart new file mode 100644 index 00000000..8039765e --- /dev/null +++ b/lib/pages/ChildVaccines/vaccinationtable_page.dart @@ -0,0 +1,136 @@ +import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/vaccination_table_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/reports_monthly_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_html/flutter_html.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; + +class VaccinationTablePage extends StatelessWidget { + @override + Widget build(BuildContext context) { + var checkedValue; + return BaseView( + onModelReady: (model) => model.getCreateVaccinationTable(),//getUserTermsAndConditions(), + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + baseViewModel: model, + appBarTitle: "Vaccination", + body: SingleChildScrollView( + child:Container( + margin: EdgeInsets.only(left: 15,right: 15,top: 70), + child: Column( + children: [//babyInformationModelList.length + ...List.generate(model.creteVaccinationTableModelList.length, (index) => + Container( + 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: double.infinity, + child: Column( + + children: [ + Html( + data:"
BCG
HEPATITIS B
"//model.creteVaccinationTableModelList[index].vaccinesDescription + , + ), + // Row(children:[Texts("CHILD NAME"),]), + // Row(children:[Texts(model.babyInformationModelList[index].babyName.trim()),]), + + // Row( + // children: [IconButton( + // icon: Image.asset(model.babyInformationModelList[index].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(model.babyInformationModelList[index].genderDescription), + // IconButton( + // icon: Icon(Icons.remove_red_eye,color: Colors.red,), + // tooltip: 'Increase volume by 10', + // onPressed: () { + // Navigator.push( + // context, + // FadePage( + // page: VaccinationTablePage(), + // + // //ChildPage(babyInformationModelList:model.BabyInformationModelList) + // // HospitalsPage( + // // findusHospitalModelList: model.FindusHospitalModelList, + // // ) + // + // ), + // ); + // // setState(() { + // // // _volume += 10; + // // // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); + // // }); + // }, + // )] + // ), + // Row(children:[Texts("Birthday"),]), + // Row(children:[IconButton( + // icon: new Image.asset('assets/images/new-design/calender-secondary.png'), + // tooltip: 'Increase volume by 10', + // onPressed: () { + // setState(() { + // // _volume += 10; + // // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); + // }); + // }, + // ), + // Texts(DateUtil.yearMonthDay(model.babyInformationModelList[index].dOB)),]), + // Row(children:[IconButton( + // icon: new Image.asset('assets/images/new-design/garbage.png'), + // tooltip: '', + // onPressed: () { + // setState(() { + // // _volume += 10; + // // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); + // }); + // }, + // ), + // Texts("Birthday"),]), + ], + ) + + + ) + + ) + ], + ), + + ), + ), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.12, + width: double.infinity, + + padding: EdgeInsets.all(12), + child: SecondaryButton( + textColor: Colors.white, + color: checkedValue== false ?Colors.white24:Color.fromRGBO(63, 72, 74, 1,), + label: " ", + // + onTap: () {} + + + ), + ), + ), + ); + } +}