import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/bottom_bar.dart'; import 'package:diplomaticquarterapp/widgets/progress_indicator/app_loader_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/robo-search/robosearch.dart'; import 'package:diplomaticquarterapp/widgets/robo-search/search.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:provider/provider.dart'; import '../../locator.dart'; import 'floating_button_search.dart'; import '../progress_indicator/app_loader_widget.dart'; import 'arrow_back.dart'; import 'network_base_view.dart'; import 'not_auh_page.dart'; class AppScaffold extends StatelessWidget { final String appBarTitle; final Widget body; final Widget bottomSheet; final bool isLoading; final bool isShowAppBar; final bool hasAppBarParam; final BaseViewModel baseViewModel; final bool isBottomBar; final Widget floatingActionButton; <<<<<<< HEAD final bool isPharmacy; ======= final String title; final String description; final bool isShowDecPage; AuthenticatedUserObject authenticatedUserObject = locator(); >>>>>>> 62efc13047052d287d62a39e3adbab7305cfe596 AppScaffold( {@required this.body, this.appBarTitle = '', this.isLoading = false, this.isShowAppBar = false, this.hasAppBarParam, this.bottomSheet, this.baseViewModel, this.floatingActionButton, <<<<<<< HEAD this.isPharmacy = false}); ======= this.title, this.description, this.isShowDecPage = true, this.isBottomBar}); >>>>>>> 62efc13047052d287d62a39e3adbab7305cfe596 @override Widget build(BuildContext context) { AppGlobal.context = context; return Scaffold( backgroundColor: Theme.of(context).scaffoldBackgroundColor, appBar: isShowAppBar ? AppBar( elevation: 0, <<<<<<< HEAD backgroundColor: isPharmacy ? Colors.green : Theme.of(context).appBarTheme.color, ======= backgroundColor: Theme.of(context).appBarTheme.color, >>>>>>> 62efc13047052d287d62a39e3adbab7305cfe596 textTheme: TextTheme( headline6: TextStyle(color: Colors.white, fontWeight: FontWeight.bold), ), <<<<<<< HEAD title: Text(appBarTitle.toUpperCase()), leading: Builder( ======= title: Text(authenticatedUserObject.isLogin ? appBarTitle.toUpperCase() : TranslationBase.of(context).serviceInformationTitle),leading: Builder( >>>>>>> 62efc13047052d287d62a39e3adbab7305cfe596 builder: (BuildContext context) { return ArrowBack(); }, ), centerTitle: true, actions: [ <<<<<<< HEAD isPharmacy ? IconButton( icon: Icon(Icons.shopping_cart), color: Colors.white, onPressed: () { Navigator.of(context) .popUntil(ModalRoute.withName('/')); }, ) : IconButton( icon: Icon(FontAwesomeIcons.home), color: Colors.white, onPressed: () { Navigator.of(context) .popUntil(ModalRoute.withName('/')); }, ), ], ) : null, body: baseViewModel != null ======= IconButton( icon: Icon(FontAwesomeIcons.home), color: Colors.white, onPressed: () { Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context) => LandingPage()), (Route r) => false); }, ), ], ) : null, body: (!authenticatedUserObject.isLogin && isShowDecPage) ? NotAutPage( title: appBarTitle, description: description, ) :baseViewModel != null >>>>>>> 62efc13047052d287d62a39e3adbab7305cfe596 ? NetworkBaseView( child: buildBodyWidget(), baseViewModel: baseViewModel, ) : buildBodyWidget(), bottomSheet: bottomSheet, <<<<<<< HEAD // bottomNavigationBar: BottomBarSearch() floatingActionButton: floatingActionButton ?? floatingActionButton, ======= floatingActionButton: floatingActionButton ?? floatingActionButton, // bottomNavigationBar: // this.isBottomBar == true ? BottomBarSearch() : SizedBox() // floatingActionButton: FloatingSearchButton(), >>>>>>> 62efc13047052d287d62a39e3adbab7305cfe596 ); } buildAppLoaderWidget(bool isLoading) { return isLoading ? AppLoaderWidget() : Container(); } buildBodyWidget() { <<<<<<< HEAD return body; //Stack(children: [body, buildAppLoaderWidget(isLoading)]); ======= // return body; //Stack(children: [body, buildAppLoaderWidget(isLoading)]); return Stack(children: [body, FloatingSearchButton()]); >>>>>>> 62efc13047052d287d62a39e3adbab7305cfe596 } }