import 'package:hexcolor/hexcolor.dart'; import '../../presentation/doctor_app_icons.dart'; import '../../widgets/shared/app_drawer_widget.dart'; import 'package:flutter/material.dart'; class AppScaffold extends StatelessWidget { AppScaffold( {this.pageOnly, this.appBarTitle, this.showAppBar, this.showBottomBar, this.showAppDrawer, this.body}); bool pageOnly = false; // bool showAll = bool showAppBar = true; bool showAppDrawer = true; bool showBottomBar = true; String appBarTitle=''; Widget body; @override Widget build(BuildContext context) { return Scaffold( backgroundColor: Hexcolor('#FCF7F7'), appBar: (pageOnly == true || showAppBar == false)?null:AppBar( elevation: 0, backgroundColor: Hexcolor('#FFDDD9'), textTheme: TextTheme( title: TextStyle(color: Colors.black, fontWeight: FontWeight.bold)), title: Text(appBarTitle), leading: Builder(builder: (BuildContext context) { return new GestureDetector( onTap: () { Scaffold.of(context).openDrawer(); }, child: IconButton( icon: Icon(Icons.menu), color: Colors.black, onPressed: () => Scaffold.of(context).openDrawer(), ), ); }), centerTitle: true, actions: [ IconButton(icon: Icon(Icons.person), onPressed: null) ], ), drawer: (pageOnly == true || showAppDrawer == false)?null:Theme( data: Theme.of(context).copyWith( canvasColor: Colors.transparent, ), child: SafeArea(child: AppDrawer()), ), // , bottomNavigationBar: (pageOnly == true || showBottomBar == false)?null: BottomNavigationBar(items: [ BottomNavigationBarItem( icon: Icon(DoctorApp.home_icon), title: Text('Home'), backgroundColor: Colors.red, activeIcon: Icon(Icons.home)), BottomNavigationBarItem( icon: new Icon(Icons.mail), title: new Text('Messages'), ), BottomNavigationBarItem(icon: Icon(Icons.apps), title: Text('Menu')) ]), body: body, ); } }