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.
111 lines
3.8 KiB
Dart
111 lines
3.8 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:hexcolor/hexcolor.dart';
|
|
|
|
import '../../config/size_config.dart';
|
|
import '../../presentation/doctor_app_icons.dart';
|
|
import '../../screens/patients/patients_screen.dart';
|
|
import '../../widgets/shared/app_drawer_widget.dart';
|
|
import '../../widgets/shared/app_loader_widget.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;
|
|
bool isloading = false;
|
|
|
|
AppScaffold(
|
|
{this.pageOnly,
|
|
this.appBarTitle,
|
|
this.showAppBar,
|
|
this.showBottomBar,
|
|
this.showAppDrawer,
|
|
this.body,
|
|
this.showbg,
|
|
this.showCurve,
|
|
this.isloading = false});
|
|
|
|
@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.toUpperCase()),
|
|
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: (pageOnly == true || showCurve == false)
|
|
? Stack(children: <Widget>[body, buildAppLoaderWidget(isloading)])
|
|
: Stack(
|
|
children: <Widget>[
|
|
ClipPath(
|
|
clipper: CustomShapeClipper(),
|
|
child: Container(
|
|
height: SizeConfig.realScreenHeight * 0.40,
|
|
decoration:
|
|
BoxDecoration(color: Hexcolor('#FFDDD9')))),
|
|
Positioned(
|
|
// key: ,
|
|
// top: SizeConfig.realScreenHeight * 0.10,
|
|
child: body),
|
|
buildAppLoaderWidget(isloading)
|
|
],
|
|
));
|
|
}
|
|
|
|
Widget buildAppLoaderWidget(bool isloading) {
|
|
return isloading ? AppLoaderWidget() : Container();
|
|
}
|
|
}
|