import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/create_e_referral_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_two_page.dart';
import 'package:flutter/material.dart';

import 'new_Home_health_care_step_one_page.dart';


class NewHomeHealthCarePage extends StatefulWidget {

  NewHomeHealthCarePage({this.model});
  final HomeHealthCareViewModel model;

  @override
  _NewHomeHealthCarePageState createState() =>
      _NewHomeHealthCarePageState();
}

class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
    with TickerProviderStateMixin {
  PageController _controller;
  int _currentIndex = 1;
  int pageSelected = 2;


  PatientERInsertPresOrderRequestModel patientERInsertPresOrderRequestModel = new PatientERInsertPresOrderRequestModel();

  @override
  void initState() {
    super.initState();
    _controller = new PageController();
  }

  @override
  void dispose() {
    super.dispose();
  }

  changePageViewIndex(pageIndex) {
    _controller.jumpToPage(pageIndex);
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: SafeArea(
        child: SingleChildScrollView(
          child: Container(
            height: MediaQuery.of(context).size.height * 0.8,
            child: PageView(
              physics: NeverScrollableScrollPhysics(),
              controller: _controller,
              onPageChanged: (index) {
                setState(() {
                  _currentIndex = index;
                });
              },
              scrollDirection: Axis.horizontal,
              children: <Widget>[
                NewHomeHealthCareStepOnePage(
                  changePageViewIndex: changePageViewIndex,
                  patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel,
                  model: widget.model,
                ),
                // NewEReferralStepTowPage(
                //   changePageViewIndex: changePageViewIndex,
                //   patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel,
                //
                // ),
                // NewEReferralStepThreePage(
                //   changePageViewIndex: changePageViewIndex,
                //   patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel,
                //
                // ),
              ],
            ),
          ),
        ),
      ),
    );
  }
}
