import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/screens/patients/patients_screen.dart'; 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 { bool pageOnly = false; // bool showAll = bool showAppBar = true; bool showAppDrawer = true; bool showBottomBar = true; bool showbg = true; bool showCurve = true; String appBarTitle = ''; Widget body; AppScaffold( {this.pageOnly, this.appBarTitle, this.showAppBar, this.showBottomBar, this.showAppDrawer, this.body, this.showbg, this.showCurve}); @override Widget build(BuildContext context) { return Scaffold( backgroundColor: (pageOnly == true || showbg == false) ? null : 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: (pageOnly == true || showCurve == false) ? body : Stack( children: [ ClipPath( clipper: CustomShapeClipper(), child: Container( height: SizeConfig.realScreenHeight * 0.40, decoration: BoxDecoration(color: Hexcolor('#FFDDD9')))), Positioned( // key: , // top: SizeConfig.realScreenHeight * 0.10, child: body) ], )); } }