AppbarProperties.fromContext constructor

AppbarProperties.fromContext(
  1. BuildContext context, {
  2. bool transparency = false,
})

Implementation

factory AppbarProperties.fromContext(
  BuildContext context, {
  bool transparency = false,
}) {
  final t = Theme.of(context).appBarTheme;
  return AppbarProperties(
    actionsIconTheme: t.actionsIconTheme ?? t.iconTheme,
    backgroundColor: transparency ? Colors.transparent : t.backgroundColor,
    elevation: t.elevation,
    foregroundColor: t.foregroundColor,
    iconTheme: t.iconTheme,
    scrolledUnderElevation: t.scrolledUnderElevation,
    shadowColor: t.shadowColor,
    shape: t.shape,
    surfaceTintColor: t.surfaceTintColor,
    titleCenter: t.centerTitle,
    titleSpacing: t.titleSpacing,
    titleTextStyle: t.titleTextStyle,
    toolbarHeight: t.toolbarHeight,
    toolbarTextStyle: t.toolbarTextStyle,
  );
}