|
|
|
@ -29,53 +29,58 @@ class AppScaffold extends StatelessWidget {
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
AppGlobal.CONTEX = context;
|
|
|
|
|
ProjectViewModel projectProvider = Provider.of(context);
|
|
|
|
|
return Scaffold(
|
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
|
appBar: isShowAppBar
|
|
|
|
|
? AppBar(
|
|
|
|
|
elevation: 0,
|
|
|
|
|
backgroundColor: HexColor('#515B5D'),
|
|
|
|
|
textTheme: TextTheme(headline6: TextStyle(color: Colors.white)),
|
|
|
|
|
title: Text(appBarTitle.toUpperCase()),
|
|
|
|
|
leading: Builder(builder: (BuildContext context) {
|
|
|
|
|
return IconButton(
|
|
|
|
|
icon: Icon(Icons.arrow_back_ios),
|
|
|
|
|
color: Colors.white, //Colors.black,
|
|
|
|
|
onPressed: () => Navigator.pop(context),
|
|
|
|
|
);
|
|
|
|
|
}),
|
|
|
|
|
centerTitle: true,
|
|
|
|
|
actions: <Widget>[
|
|
|
|
|
IconButton(
|
|
|
|
|
icon: Icon(DoctorApp.home_icon_active),
|
|
|
|
|
color: Colors.white, //Colors.black,
|
|
|
|
|
onPressed: () => Navigator.pushNamedAndRemoveUntil(
|
|
|
|
|
context, HOME, (r) => false),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
: null,
|
|
|
|
|
body: projectProvider.isInternetConnection
|
|
|
|
|
? baseViewModel != null
|
|
|
|
|
? NetworkBaseView(
|
|
|
|
|
baseViewModel: baseViewModel,
|
|
|
|
|
child: body,
|
|
|
|
|
)
|
|
|
|
|
: Stack(
|
|
|
|
|
children: <Widget>[body, buildAppLoaderWidget(isLoading)])
|
|
|
|
|
: Center(
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Image.asset(
|
|
|
|
|
"assets/images/undraw_connected_world_wuay.png",
|
|
|
|
|
height: 250,
|
|
|
|
|
),
|
|
|
|
|
AppText('No Internet Connection')
|
|
|
|
|
],
|
|
|
|
|
return GestureDetector(
|
|
|
|
|
onTap: (){
|
|
|
|
|
FocusScope.of(context).requestFocus(new FocusNode());
|
|
|
|
|
},
|
|
|
|
|
child: Scaffold(
|
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
|
appBar: isShowAppBar
|
|
|
|
|
? AppBar(
|
|
|
|
|
elevation: 0,
|
|
|
|
|
backgroundColor: HexColor('#515B5D'),
|
|
|
|
|
textTheme: TextTheme(headline6: TextStyle(color: Colors.white)),
|
|
|
|
|
title: Text(appBarTitle.toUpperCase()),
|
|
|
|
|
leading: Builder(builder: (BuildContext context) {
|
|
|
|
|
return IconButton(
|
|
|
|
|
icon: Icon(Icons.arrow_back_ios),
|
|
|
|
|
color: Colors.white, //Colors.black,
|
|
|
|
|
onPressed: () => Navigator.pop(context),
|
|
|
|
|
);
|
|
|
|
|
}),
|
|
|
|
|
centerTitle: true,
|
|
|
|
|
actions: <Widget>[
|
|
|
|
|
IconButton(
|
|
|
|
|
icon: Icon(DoctorApp.home_icon_active),
|
|
|
|
|
color: Colors.white, //Colors.black,
|
|
|
|
|
onPressed: () => Navigator.pushNamedAndRemoveUntil(
|
|
|
|
|
context, HOME, (r) => false),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
: null,
|
|
|
|
|
body: projectProvider.isInternetConnection
|
|
|
|
|
? baseViewModel != null
|
|
|
|
|
? NetworkBaseView(
|
|
|
|
|
baseViewModel: baseViewModel,
|
|
|
|
|
child: body,
|
|
|
|
|
)
|
|
|
|
|
: Stack(
|
|
|
|
|
children: <Widget>[body, buildAppLoaderWidget(isLoading)])
|
|
|
|
|
: Center(
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Image.asset(
|
|
|
|
|
"assets/images/undraw_connected_world_wuay.png",
|
|
|
|
|
height: 250,
|
|
|
|
|
),
|
|
|
|
|
AppText('No Internet Connection')
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|