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.
HMG_QLine/lib/views/common_widgets/app_scaffold.dart

53 lines
1.4 KiB
Dart

10 months ago
import 'package:flutter/material.dart';
class AppScaffold extends StatelessWidget {
final String appBarTitle;
final Widget body;
final bool isLoading;
final bool resizeToAvoidBottomInset;
10 months ago
final bool isShowAppBar;
final Widget? bottomSheet;
final Color? backgroundColor;
final PreferredSizeWidget appBar;
final Widget drawer;
final Widget bottomNavigationBar;
final String subtitle;
final bool isHomeIcon;
final bool extendBody;
const AppScaffold({
super.key,
this.appBarTitle = '',
required this.body,
this.isLoading = false,
this.resizeToAvoidBottomInset = false,
10 months ago
this.isShowAppBar = true,
this.bottomSheet,
this.backgroundColor,
this.isHomeIcon = true,
required this.appBar,
this.subtitle = "",
this.drawer = const SizedBox.shrink(),
this.extendBody = false,
required this.bottomNavigationBar,
});
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () {
FocusScope.of(context).requestFocus(FocusNode());
},
child: Scaffold(
resizeToAvoidBottomInset: resizeToAvoidBottomInset,
10 months ago
backgroundColor: backgroundColor ?? Theme.of(context).scaffoldBackgroundColor,
drawer: drawer,
extendBody: extendBody,
bottomNavigationBar: bottomNavigationBar,
appBar: isShowAppBar ? appBar : null,
bottomSheet: bottomSheet,
body: body),
);
}
}