largeFormatAwareAppBar function
- BuildContext context,
- String title,
- {Color? background,
- List<
Widget> ? actions, - VoidCallback? onDismiss}
Wraps an AppBar and configures the automaticallyImplyLeading flag based on isLargeFormatLayout
Implementation
AppBar largeFormatAwareAppBar(BuildContext context, String title,
{Color? background, List<Widget>? actions, VoidCallback? onDismiss}) {
return AppBar(
backgroundColor: background,
shadowColor: background,
automaticallyImplyLeading: !isLargeFormatLayout(context),
title: Text(title),
actions: actions,
leading: isLargeFormatLayout(context)
? CloseButton(
onPressed: onDismiss ??
() => Navigator.of(context, rootNavigator: true).maybePop(),
)
: null,
);
}