import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; import 'package:diplomaticquarterapp/pages/ErService/widgets/StepsWidget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'BillAmount.dart'; import 'PickupLocation.dart'; import 'SelectTransportationMethod.dart'; import 'Summary.dart'; class AmbulanceRequestIndexPage extends StatefulWidget { final AmRequestViewModel amRequestViewModel; AmbulanceRequestIndexPage({Key key, this.amRequestViewModel}); @override _AmbulanceRequestIndexPageState createState() => _AmbulanceRequestIndexPageState(); } class _AmbulanceRequestIndexPageState extends State { int currentIndex = 0; PageController pageController; PatientER _patientER = PatientER(); _changeCurrentTab(int tab) { setState(() { currentIndex = tab; }); pageController.animateToPage(tab, duration: Duration(milliseconds: 800), curve: Curves.easeOutQuart); } @override void initState() { super.initState(); pageController = new PageController(); } @override Widget build(BuildContext context) { return AppScaffold( body: Column( children: [ SizedBox( height: 80, ), Container( margin: EdgeInsets.only(left: 12, right: 12), child: StepsWidget( index: currentIndex, changeCurrentTab: _changeCurrentTab, )), Expanded( child: PageView( physics: NeverScrollableScrollPhysics(), controller: pageController, children: [ //Container(), SelectTransportationMethod( changeCurrentTab: _changeCurrentTab, patientER: _patientER, amRequestViewModel: widget.amRequestViewModel, ), PickupLocation( changeCurrentTab: _changeCurrentTab, patientER: _patientER, amRequestViewModel: widget.amRequestViewModel, ), BillAmount( changeCurrentTab: _changeCurrentTab, patientER: _patientER, amRequestViewModel: widget.amRequestViewModel, ), Summary( changeCurrentTab: _changeCurrentTab, patientER: _patientER, amRequestViewModel: widget.amRequestViewModel, ), ], ), ), ], ), ); } }