import 'package:diplomaticquarterapp/pages/ErService/widgets/StepesWideget.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 AmbulanceRequestIndex extends StatefulWidget { @override _AmbulanceRequestIndexState createState() => _AmbulanceRequestIndexState(); } class _AmbulanceRequestIndexState extends State { int currentIndex = 0; PageController pageController; _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: StepesWidget(index: currentIndex,changeCurrentTab: _changeCurrentTab,)), Expanded( child: PageView( physics: NeverScrollableScrollPhysics(), controller: pageController, children: [ SelectTransportationMethod(changeCurrentTab: _changeCurrentTab,), PickupLocation(changeCurrentTab: _changeCurrentTab,), BillAmount(changeCurrentTab: _changeCurrentTab,), Summary(changeCurrentTab: _changeCurrentTab,), ], ), ), ], ), ); } }