mergeFlutterTheme method

SidebarXTheme mergeFlutterTheme(
  1. BuildContext context
)

Method to get default flutter theme settings

Implementation

SidebarXTheme mergeFlutterTheme(BuildContext context) {
  final theme = Theme.of(context);
  final mergedTheme = SidebarXTheme(
    width: width,
    height: height,
    padding: padding,
    margin: margin,
    decoration: decoration ?? BoxDecoration(color: theme.cardColor),
    iconTheme: iconTheme ?? theme.iconTheme,
    selectedIconTheme: selectedIconTheme ??
        theme.iconTheme.copyWith(color: theme.primaryColor),
    hoverIconTheme: selectedIconTheme ??
        theme.iconTheme.copyWith(color: theme.primaryColor),
    textStyle: textStyle ?? theme.textTheme.bodyMedium,
    selectedTextStyle: selectedTextStyle ??
        theme.textTheme.bodyMedium?.copyWith(color: theme.primaryColor),
    itemDecoration: itemDecoration,
    selectedItemDecoration: selectedItemDecoration,
    itemMargin: itemMargin,
    selectedItemMargin: selectedItemMargin,
    itemPadding: itemPadding,
    selectedItemPadding: selectedItemPadding,
    itemTextPadding: itemTextPadding,
    selectedItemTextPadding: selectedItemTextPadding,
    hoverColor: hoverColor ?? theme.hoverColor,
    hoverTextStyle: hoverTextStyle ??
        theme.textTheme.bodyMedium?.copyWith(color: theme.primaryColor),
  );
  return mergedTheme;
}