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

50 lines
1.7 KiB
Dart

import 'package:doctor_app_flutter/routes.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import '../../presentation/doctor_app_icons.dart';
import '../../widgets/shared/app_loader_widget.dart';
class AppScaffold extends StatelessWidget {
String appBarTitle;
Widget body;
bool isLoading;
AppScaffold({this.appBarTitle ='', this.body, this.isLoading = false});
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Hexcolor('#F5F5F5'),
appBar: appBarTitle != ''
? AppBar(
elevation: 0,
backgroundColor: Hexcolor('#515B5D'),
textTheme: TextTheme(
headline6: TextStyle(
color: Colors.white, fontWeight: FontWeight.bold)),
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: Stack(children: <Widget>[body, buildAppLoaderWidget(isLoading)]));
}
Widget buildAppLoaderWidget(bool isloading) {
return isloading ? AppLoaderWidget() : Container();
}
}