NavigationPaneThemeData.fromResources constructor

NavigationPaneThemeData.fromResources({
  1. required ResourceDictionary resources,
  2. required Duration animationDuration,
  3. required Curve animationCurve,
  4. required Color highlightColor,
  5. required Typography typography,
})

The default navigation pane theme data.

This is initialized on FluentThemeData with the required properties.

Implementation

factory NavigationPaneThemeData.fromResources({
  required ResourceDictionary resources,
  required Duration animationDuration,
  required Curve animationCurve,
  required Color highlightColor,
  required Typography typography,
}) {
  return NavigationPaneThemeData(
    animationDuration: animationDuration,
    animationCurve: animationCurve,
    backgroundColor: resources.solidBackgroundFillColorBase,
    overlayBackgroundColor: resources.systemFillColorSolidNeutralBackground,
    highlightColor: highlightColor,
    itemHeaderTextStyle: typography.bodyStrong,
    selectedTextStyle: ButtonState.resolveWith((states) {
      return typography.body?.copyWith(
        color: states.isPressing
            ? resources.textFillColorSecondary
            : states.isDisabled
                ? resources.textFillColorDisabled
                : resources.textFillColorPrimary,
      );
    }),
    unselectedTextStyle: ButtonState.resolveWith((states) {
      return typography.body?.copyWith(
        color: states.isPressing
            ? resources.textFillColorSecondary
            : states.isDisabled
                ? resources.textFillColorDisabled
                : resources.textFillColorPrimary,
      );
    }),
    selectedTopTextStyle: ButtonState.resolveWith((states) {
      return typography.body?.copyWith(
        color: states.isPressing
            ? resources.textFillColorTertiary
            : states.isHovering
                ? resources.textFillColorSecondary
                : resources.textFillColorPrimary,
      );
    }),
    unselectedTopTextStyle: ButtonState.resolveWith((states) {
      return typography.body?.copyWith(
        color: states.isPressing
            ? resources.textFillColorSecondary
            : states.isDisabled
                ? resources.textFillColorDisabled
                : resources.textFillColorPrimary,
      );
    }),
    labelPadding: const EdgeInsetsDirectional.only(end: 10.0),
    iconPadding: const EdgeInsets.symmetric(horizontal: 10.0),
    headerPadding: const EdgeInsetsDirectional.only(top: 10.0),
    paneNavigationButtonIcon: FluentIcons.global_nav_button,
  );
}