import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/assessment_page.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/objective_page.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/plan_page.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/subjective/subjective_page.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import '../patient_profile_widget.dart'; import 'steps_widget.dart'; class AddSOAPIndex extends StatefulWidget { final bool isUpdate; const AddSOAPIndex({Key key, this.isUpdate}) : super(key: key); @override _AddSOAPIndexState createState() => _AddSOAPIndexState(); } class _AddSOAPIndexState extends State with TickerProviderStateMixin { PageController _controller; int _currentIndex = 0; List myAllergiesList= List(); List myHistoryList = List(); List mySelectedExamination = List(); MySelectedAssessment mySelectedAssessment = new MySelectedAssessment(); changePageViewIndex(pageIndex) { _controller.jumpToPage(pageIndex); } @override void initState() { // TODO: implement initState _controller = new PageController(); super.initState(); } @override Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; return BaseView( builder: (_, model, w) => AppScaffold( baseViewModel: model, appBarTitle: TranslationBase.of(context).healthRecordInformation, body: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( decoration: BoxDecoration(boxShadow: [], color: Colors.white), child: Column( mainAxisAlignment: MainAxisAlignment.start, children: [ Padding( padding: const EdgeInsets.all(8.0), child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ AvatarWidget( Icon( patient.genderDescription == "Male" ? DoctorApp.male : DoctorApp.female_icon, size: 70, color: Colors.white, ), ), SizedBox( width: 20, ), Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, children: [ SizedBox( height: 5, ), AppText( patient.firstName + ' ' + patient.lastName, color: Colors.black, fontWeight: FontWeight.bold, ), Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( TranslationBase.of(context).age, color: Colors.black, fontWeight: FontWeight.bold, ), SizedBox( width: 20, ), AppText( patient.age.toString(), color: Colors.black, fontWeight: FontWeight.normal, ), ], ), Container( width: MediaQuery.of(context).size.width *0.65, child: AppText( "ALLERGIC TO: FOOD, ASPIRIN, EGG WHITE", color: Color(0xFFB9382C), fontWeight: FontWeight.bold, ), ), ], ) ], ), ), Container( width: double.infinity, height: 1, color: Color(0xffCCCCCC), ), SizedBox( width: 20, ), FractionallySizedBox( child: SingleChildScrollView( child: Container( height: MediaQuery.of(context).size.height * 0.75, child: Column( children: [ Container( margin: EdgeInsets.only( left: MediaQuery.of(context).size.width * 0.05, right: MediaQuery.of(context).size.width * 0.05), child: StepsWidget( index: _currentIndex, changeCurrentTab: changePageViewIndex, ), ), Expanded( child: PageView( physics: NeverScrollableScrollPhysics(), controller: _controller, onPageChanged: (index) { setState(() { _currentIndex = index; }); }, scrollDirection: Axis.horizontal, children: [ SubjectivePage(changePageViewIndex: changePageViewIndex,myAllergiesList: myAllergiesList,myHistoryList: myHistoryList,), ObjectivePage(changePageViewIndex: changePageViewIndex,mySelectedExamination:mySelectedExamination), AssessmentPage(changePageViewIndex: changePageViewIndex,mySelectedAssessment:mySelectedAssessment), PlanPage(changePageViewIndex: changePageViewIndex,) ], ), ), ], ), ), ), ) ], ), ), ], ), ), ), ); } }