Skip to content

feat: extract appBar background color and blurred surface to config pipeline#978

Closed
SERDUN wants to merge 2 commits into
developfrom
feature/appbar-blurred-surface-config
Closed

feat: extract appBar background color and blurred surface to config pipeline#978
SERDUN wants to merge 2 commits into
developfrom
feature/appbar-blurred-surface-config

Conversation

@SERDUN

@SERDUN SERDUN commented Feb 27, 2026

Copy link
Copy Markdown
Member

Summary

  • Add appBarBackgroundColor and appBarBlurredSurface (color, sigmaX, sigmaY) to BasePageConfig and all page configs
  • Create BlurredSurfaceConfig (freezed DTO) and BlurredSurfaceStyle with full config→style→factory→screen pipeline
  • Update all 7 main screens (Keypad, Contacts, Favorites, Recents, Conversations, Settings, About) to use configurable blur params
  • Update page configuration documentation with new common fields

Test plan

  • Verify keypad screen renders with configured appBarBackgroundColor
  • Verify appBarBlurredSurface with custom color/sigmaX/sigmaY produces correct blur effect
  • Verify screens without config values fall back to defaults
  • Run flutter analyze — no issues

…ipeline

Add configurable appBarBackgroundColor and appBarBlurredSurface (color, sigmaX, sigmaY)
to the theme config→style pipeline across all 7 main screens, replacing hardcoded values.
Add Common page fields section documenting appBarBackgroundColor
and appBarBlurredSurface, update Keypad page example.
@SERDUN SERDUN changed the base branch from main to develop February 27, 2026 08:12
@SERDUN SERDUN requested a review from Copilot February 27, 2026 08:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request extracts app bar background color and blurred surface configuration from hardcoded values into a configurable pipeline. It introduces two new common fields (appBarBackgroundColor and appBarBlurredSurface) to the BasePageConfig interface, making them available across all page configurations.

Changes:

  • Created BlurredSurfaceConfig (freezed DTO) and BlurredSurfaceStyle to represent blur configuration and visual styling
  • Added appBarBackgroundColor and appBarBlurredSurface to BasePageConfig and all implementing page configs
  • Updated all 7 main screens and their factories to use configurable blur parameters instead of hardcoded values
  • Modified BlurredSurface widget to accept parameters without defaults
  • Added documentation for the new common page fields

Reviewed changes

Copilot reviewed 35 out of 35 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/webtrit_appearance_theme/lib/models/common/blurred_surface_config.dart New freezed model for blur configuration with color, sigmaX, sigmaY
packages/webtrit_appearance_theme/lib/models/common/blurred_surface_config.g.dart Generated JSON serialization code
packages/webtrit_appearance_theme/lib/models/common/blurred_surface_config.freezed.dart Generated freezed code for immutable model
packages/webtrit_appearance_theme/lib/models/common/common.dart Export statement for new config
packages/webtrit_appearance_theme/lib/models/pages/base_page_config.dart Added appBarBackgroundColor and appBarBlurredSurface getters
packages/webtrit_appearance_theme/lib/models/theme_page_config.dart Added new fields to all page config classes
packages/webtrit_appearance_theme/lib/models/theme_page_config.g.dart Generated JSON serialization for all page configs
packages/webtrit_appearance_theme/lib/models/theme_page_config.freezed.dart Generated freezed code for all page configs
lib/widgets/blurred_surface_style.dart New style class with merge/lerp support
lib/widgets/blurred_surface.dart Changed default sigma values from 10 to 0, removed default color logic
lib/theme/extension/blurred_surface_config_extension.dart Extension to convert config to style
lib/theme/extension/extension.dart Export for new extension
lib/theme/styles/base_screen_style.dart Added appBar fields to base style
lib/theme/factory/styles/*_screen_style_factory.dart All 7 factories updated to wire config to style
lib/features//view/_screen_style.dart All 7 screen styles updated with new fields
lib/features//view/_screen.dart All 7 screens updated to use configurable blur
docs/page_configuration.md Documentation for new common fields
Comments suppressed due to low confidence (1)

lib/widgets/blurred_surface.dart:27

  • The default color logic was removed from the BlurredSurface widget. Previously, it would fall back to Theme.of(context).canvasColor.withAlpha(150) when no color was provided. Now it directly uses the nullable color, which could result in a transparent overlay when no color is configured. This breaks the fallback behavior and may result in screens having no visible overlay color when the config doesn't specify one.
    return ClipRect(
      child: BackdropFilter(
        filter: ImageFilter.blur(sigmaX: sigmaX, sigmaY: sigmaY),
        child: child ?? Container(color: color),
      ),
    );

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

/// scrollable content appears blurred beneath the app bar.
class BlurredSurface extends StatelessWidget {
const BlurredSurface({super.key, this.color, this.sigmaX = 10, this.sigmaY = 10, this.child});
const BlurredSurface({super.key, this.color, this.sigmaX = 0, this.sigmaY = 0, this.child});

Copilot AI Feb 27, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default blur sigma values were changed from 10 to 0. When sigmaX and sigmaY are both 0, no blur effect is applied. This is a breaking change that will affect all existing uses of BlurredSurface that relied on the default blur effect. Screens need to explicitly provide non-zero values or the blur effect will be disabled by default.

Suggested change
const BlurredSurface({super.key, this.color, this.sigmaX = 0, this.sigmaY = 0, this.child});
const BlurredSurface({super.key, this.color, this.sigmaX = 10, this.sigmaY = 10, this.child});

Copilot uses AI. Check for mistakes.
Comment on lines +35 to +36
sigmaX: effectiveStyle?.appBarBlurredSurface?.sigmaX ?? 0,
sigmaY: effectiveStyle?.appBarBlurredSurface?.sigmaY ?? 0,

Copilot AI Feb 27, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All screens now default to 0 for blur sigma values when no config is provided. This means that without explicit configuration, the blur effect will be disabled across all screens. This is a behavioral breaking change - previously the BlurredSurface widget had default values of 10 for both sigmaX and sigmaY. Consider using a sensible non-zero default (e.g., 10) to maintain backward compatibility and avoid requiring configuration for basic blur functionality.

Suggested change
sigmaX: effectiveStyle?.appBarBlurredSurface?.sigmaX ?? 0,
sigmaY: effectiveStyle?.appBarBlurredSurface?.sigmaY ?? 0,
sigmaX: effectiveStyle?.appBarBlurredSurface?.sigmaX ?? 10,
sigmaY: effectiveStyle?.appBarBlurredSurface?.sigmaY ?? 10,

Copilot uses AI. Check for mistakes.
Comment on lines +19 to +25
BlurredSurfaceStyle copyWith({Color? color, double? sigmaX, double? sigmaY}) {
return BlurredSurfaceStyle(
color: color ?? this.color,
sigmaX: sigmaX ?? this.sigmaX,
sigmaY: sigmaY ?? this.sigmaY,
);
}

Copilot AI Feb 27, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The copyWith method has a flaw: it cannot distinguish between explicitly passing null and not passing a parameter. If you want to set a value to null explicitly, you cannot do so with this implementation. Consider using a pattern with optional parameters wrapped in Option types, or document that null values cannot be explicitly set via copyWith.

Copilot uses AI. Check for mistakes.
Comment on lines +409 to +413
| Key | Type | Default | Description |
|----------|--------|---------|--------------------------------------|
| `color` | string | `null` | Overlay color (hex). |
| `sigmaX` | double | `0` | Horizontal gaussian blur sigma. |
| `sigmaY` | double | `0` | Vertical gaussian blur sigma. |

Copilot AI Feb 27, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation states that the default blur sigma values are 0, but this effectively disables the blur effect entirely. Consider clarifying in the documentation that users must explicitly configure non-zero values for sigmaX and sigmaY to achieve any blur effect, and provide guidance on recommended values (e.g., 10 for a typical frosted-glass effect).

Suggested change
| Key | Type | Default | Description |
|----------|--------|---------|--------------------------------------|
| `color` | string | `null` | Overlay color (hex). |
| `sigmaX` | double | `0` | Horizontal gaussian blur sigma. |
| `sigmaY` | double | `0` | Vertical gaussian blur sigma. |
| Key | Type | Default | Description |
|----------|--------|---------|---------------------------------------------------------------------------------------|
| `color` | string | `null` | Overlay color (hex). |
| `sigmaX` | double | `0` | Horizontal gaussian blur sigma. `0` means no blur; use a non-zero value (e.g. `10`). |
| `sigmaY` | double | `0` | Vertical gaussian blur sigma. `0` means no blur; use a non-zero value (e.g. `10`). |

Copilot uses AI. Check for mistakes.
@SERDUN SERDUN added the draft Not ready but can be start to review label Feb 27, 2026
@SERDUN SERDUN closed this Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

draft Not ready but can be start to review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants