You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
doctor_app_flutter/lib/widgets/shared/app_scaffold_widget.dart

71 lines
2.1 KiB
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(
appBar: (pageOnly == true || showAppBar == false)?null:AppBar(
elevation: 0,
backgroundColor: Colors.red[100],
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: <Widget>[
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,
);
}
}