import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/parent_categorise_page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-order-page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy_module_page.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/profile/profile.dart'; import 'package:diplomaticquarterapp/pages/pharmacy_categorise.dart'; import 'package:diplomaticquarterapp/pages/search_products_page.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.dart'; import 'package:diplomaticquarterapp/widgets/pharmacy/bottom_nav_pharmacy_bar.dart'; import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/wishlist.dart'; import '../offers_categorise_page.dart'; class LandingPagePharmacy extends StatefulWidget { @override _LandingPagePharmacyState createState() => _LandingPagePharmacyState(); } class _LandingPagePharmacyState extends State { int currentTab = 0; PageController pageController; ProjectViewModel projectProvider; _changeCurrentTab(int tab) { setState(() { currentTab = tab; pageController.jumpToPage(tab); }); } void initState() { super.initState(); pageController = PageController(keepPage: true); } @override Widget build(BuildContext context) { return Scaffold( appBar: currentTab == 0 || currentTab == 1 ? AppBar( backgroundColor: Color(0xff5AB145), elevation: 0, title: Container( height: MediaQuery.of(context).size.height * 0.056, decoration: BoxDecoration( borderRadius: BorderRadius.circular(5.0), color: Colors.white, ), child: InkWell( child: Padding( padding: EdgeInsets.all(8.0), child: Row( //crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.start, children: [ Icon(Icons.search, size: 25.0), SizedBox( width: 15.0, ), Texts( TranslationBase.of(context).searchProductHere, fontSize: 13, ) ], ), ), onTap: () { Navigator.push( context, MaterialPageRoute( builder: (context) => SearchProductsPage()), ); }, ), ), leading: Builder( builder: (BuildContext context) { return Container( height: 2.0, width: 10.0, child: Image.asset( 'assets/images/pharmacy_logo.png', ), ); }, ), actions: [ // IconButton( // iconSize: 70, // icon: SvgPicture.asset('assets/images/svg/robort_svg.svg', // height: 100, width: 100, fit: BoxFit.cover), // onPressed: () { // triggerRobot(); // } //do something, // ) ], centerTitle: true, ) : currentTab == 4 ? null : AppBar( backgroundColor: Color(0xff5AB145), elevation: 0, textTheme: TextTheme( headline6: TextStyle( color: Colors.white, fontWeight: FontWeight.bold), ), title: Text(getText(currentTab).toUpperCase()), leading: Builder( builder: (BuildContext context) { return IconButton( icon: Icon(Icons.arrow_back), color: Colors.white, onPressed: () => Scaffold.of(context).openDrawer(), ); }, ), actions: [ // IconButton( // iconSize: 70, // icon: SvgPicture.asset('assets/images/svg/robort_svg.svg', // height: 100, width: 100, fit: BoxFit.cover), // onPressed: () { // triggerRobot(); // } //do something, // ) ], centerTitle: true, ), extendBody: false, body: PageView( physics: NeverScrollableScrollPhysics(), controller: pageController, children: [ PharmacyPage(), PharmacyCategorisePage(), // OffersCategorisePage(), WishlistPage(), PharmacyProfilePage(), // Container( // child: Text('text'), // ), CartOrderPage(), ], // Please do not remove the BookingOptions from this array ), bottomNavigationBar: BottomNavPharmacyBar( changeIndex: _changeCurrentTab, index: currentTab, ), ); } getText(currentTab) { switch (currentTab) { case 2: return 'Wishlist'; case 3: return 'My Account'; case 4: return 'Shopping Cart'; } } }