Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,18 @@ jobs:
id-token: write
contents: read

check_mix_protocol_release:
if: startsWith(github.ref_name, 'mix_protocol-v') && github.ref_name != 'mix_protocol-v1.0.0-alpha.0'
uses: ./.github/workflows/release-dependencies.yml
with:
package: protocol
permissions:
contents: read

publish_mix_protocol:
# pub.dev requires the first version to be published manually. The initial
# release tag is kept for traceability but must not attempt OIDC publishing.
needs: check_mix_protocol_release
if: startsWith(github.ref_name, 'mix_protocol-v') && github.ref_name != 'mix_protocol-v1.0.0-alpha.0'
uses: btwld/dart-actions/.github/workflows/publish.yml@main
with:
Expand All @@ -69,7 +78,16 @@ jobs:
id-token: write
contents: read

check_mix_winds_release:
if: startsWith(github.ref_name, 'mix_winds-v')
uses: ./.github/workflows/release-dependencies.yml
with:
package: winds
permissions:
contents: read

publish_mix_winds:
needs: check_mix_winds_release
if: startsWith(github.ref_name, 'mix_winds-v')
uses: btwld/dart-actions/.github/workflows/publish.yml@main
with:
Expand Down
96 changes: 96 additions & 0 deletions .github/workflows/release-dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Hosted dependency release checks

on:
workflow_dispatch:
inputs:
package:
description: Dependent package to validate before tagging
required: true
type: choice
options: [all, protocol, winds]
default: all
workflow_call:
inputs:
package:
required: true
type: string

permissions:
contents: read

jobs:
protocol:
if: ${{ inputs.package == 'all' || inputs.package == 'protocol' }}
name: Protocol / Hosted release check
runs-on: ubuntu-latest
timeout-minutes: 30
defaults:
run:
working-directory: packages/mix_protocol
steps:
- uses: actions/checkout@v4
- uses: kuhnroyal/flutter-fvm-config-action@v2
id: fvm-config-action
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }}
channel: ${{ steps.fvm-config-action.outputs.FLUTTER_CHANNEL }}
# No Melos or path overrides: every version selected below is hosted.
- name: Resolve hosted dependencies
run: flutter pub get
- name: Resolve minimum allowed Mix
run: flutter pub downgrade mix
- name: Show minimum selected Mix
run: dart pub deps --json | jq -r '.packages[] | select(.name == "mix") | "selected mix \(.version) from \(.source)"'
- name: Analyze against minimum Mix
run: flutter analyze --no-fatal-infos
- name: Test against minimum Mix
run: flutter test
- name: Resolve latest allowed Mix
run: flutter pub upgrade mix
- name: Show latest selected Mix
run: dart pub deps --json | jq -r '.packages[] | select(.name == "mix") | "selected mix \(.version) from \(.source)"'
- name: Analyze against latest Mix
run: flutter analyze --no-fatal-infos
- name: Test against latest Mix
run: flutter test
- name: Restore files modified by Flutter tooling
run: git restore -- .
- name: Validate publish archive
run: dart pub publish --dry-run

winds:
if: ${{ inputs.package == 'all' || inputs.package == 'winds' }}
name: Winds / Hosted release check
runs-on: ubuntu-latest
timeout-minutes: 30
defaults:
run:
working-directory: packages/mix_winds
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: stable
- name: Resolve hosted dependencies
run: flutter pub get
- name: Resolve minimum allowed Mix and Protocol
run: flutter pub downgrade mix mix_protocol
- name: Show minimum selected dependencies
run: dart pub deps --json | jq -r '.packages[] | select(.name == "mix" or .name == "mix_protocol") | "selected \(.name) \(.version) from \(.source)"'
- name: Analyze against minimum dependencies
run: flutter analyze --no-fatal-infos
- name: Test against minimum dependencies
run: flutter test
- name: Resolve latest allowed Mix and Protocol
run: flutter pub upgrade mix mix_protocol
- name: Show latest selected dependencies
run: dart pub deps --json | jq -r '.packages[] | select(.name == "mix" or .name == "mix_protocol") | "selected \(.name) \(.version) from \(.source)"'
- name: Analyze against latest dependencies
run: flutter analyze --no-fatal-infos
- name: Test against latest dependencies
run: flutter test
- name: Restore files modified by Flutter tooling
run: git restore -- .
- name: Validate publish archive
run: dart pub publish --dry-run
72 changes: 49 additions & 23 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
format:
name: Format Check
Expand Down Expand Up @@ -91,8 +94,11 @@ jobs:
- run: flutter test
- run: flutter build web

winds-release:
name: Winds / Release dependency check
# Exercise each dependent against the source tree in this commit. Hosted
# compatibility and publish archives are checked by release-dependencies.yml
# before a dependent's publish job can start.
winds-in-repo:
name: Winds / In-repo dependencies
runs-on: ubuntu-latest
timeout-minutes: 20
defaults:
Expand All @@ -103,20 +109,36 @@ jobs:
- uses: subosito/flutter-action@v2
with:
channel: stable
# Match release installation before Melos creates local overrides.
- name: Resolve hosted release dependencies
- name: Use in-repo dependencies
run: |
cat > pubspec_overrides.yaml <<'YAML'
dependency_overrides:
mix:
path: ../mix
mix_annotations:
path: ../mix_annotations
mix_protocol:
path: ../mix_protocol
YAML
cat > example/pubspec_overrides.yaml <<'YAML'
dependency_overrides:
mix:
path: ../../mix
mix_annotations:
path: ../../mix_annotations
mix_protocol:
path: ../../mix_protocol
YAML
- name: Resolve dependencies
run: flutter pub get
- name: Analyze against published Mix
run: flutter analyze
- name: Test against published Mix
# Infos are not fatal, matching `melos run analyze:dart`: deprecations
# in unreleased Mix surface as infos in dependents.
- name: Analyze
run: flutter analyze --no-fatal-infos
- name: Test
run: flutter test
- name: Restore files modified by Flutter tooling
run: git restore -- .
- name: Validate publish archive
run: dart pub publish --dry-run

protocol-release:
name: Protocol / Release dependency check
protocol-in-repo:
name: Protocol / In-repo dependencies
runs-on: ubuntu-latest
timeout-minutes: 20
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
defaults:
Expand All @@ -130,17 +152,21 @@ jobs:
with:
flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }}
channel: ${{ steps.fvm-config-action.outputs.FLUTTER_CHANNEL }}
- name: Resolve hosted release dependencies
- name: Use in-repo dependencies
run: |
cat > pubspec_overrides.yaml <<'YAML'
dependency_overrides:
mix:
path: ../mix
mix_annotations:
path: ../mix_annotations
YAML
- name: Resolve dependencies
run: flutter pub get
- name: Analyze against published Mix
run: flutter analyze
- name: Test against published Mix
- name: Analyze
run: flutter analyze --no-fatal-infos
- name: Test
run: flutter test
- name: Restore files modified by Flutter tooling
run: git restore -- .
- name: Validate publish archive
run: dart pub publish --dry-run

protocol-schema:
name: Protocol Schema / Ajv check
runs-on: ubuntu-latest
Expand Down
16 changes: 14 additions & 2 deletions packages/mix/lib/src/modifiers/blur_modifier.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,25 @@ import '../core/widget_modifier.dart';
part 'blur_modifier.g.dart';

/// Modifier that applies a Gaussian blur filter to its child.
///
/// Wraps the child in an [ImageFiltered] widget using [ui.ImageFilter.blur].
@MixableModifier()
final class BlurModifier with _$BlurModifier {
/// Blur sigma for X and Y axis.
@override
final double sigma;

const BlurModifier([double? sigma]) : sigma = sigma ?? 0.0;
/// How the blur treats pixels outside the child's bounds.
///
/// Defaults to [ui.TileMode.clamp], which extends edge pixels. Use
/// [ui.TileMode.decal] for soft glows and blooms, where the blurred shape
/// should fade to transparent instead of smearing its edges.
@override
final ui.TileMode tileMode;

const BlurModifier([double? sigma, ui.TileMode? tileMode])
: sigma = sigma ?? 0.0,
tileMode = tileMode ?? ui.TileMode.clamp;

@override
Widget build(Widget child) {
Expand All @@ -28,7 +40,7 @@ final class BlurModifier with _$BlurModifier {
imageFilter: ui.ImageFilter.blur(
sigmaX: sigma,
sigmaY: sigma,
tileMode: ui.TileMode.clamp,
tileMode: tileMode,
),
child: child,
);
Expand Down
38 changes: 27 additions & 11 deletions packages/mix/lib/src/modifiers/blur_modifier.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions packages/mix/lib/src/modifiers/widget_modifier_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,10 @@ final class WidgetModifierConfig with Equatable {
return WidgetModifierConfig.modifier(OpacityModifierMix(opacity: opacity));
}

factory WidgetModifierConfig.blur(double sigma) {
return WidgetModifierConfig.modifier(BlurModifierMix(sigma: sigma));
factory WidgetModifierConfig.blur(double sigma, {TileMode? tileMode}) {
return WidgetModifierConfig.modifier(
BlurModifierMix(sigma: sigma, tileMode: tileMode),
);
}

factory WidgetModifierConfig.aspectRatio(double aspectRatio) {
Expand Down Expand Up @@ -456,8 +458,8 @@ final class WidgetModifierConfig with Equatable {
return merge(WidgetModifierConfig.opacity(value));
}

WidgetModifierConfig blur(double sigma) {
return merge(WidgetModifierConfig.blur(sigma));
WidgetModifierConfig blur(double sigma, {TileMode? tileMode}) {
return merge(WidgetModifierConfig.blur(sigma, tileMode: tileMode));
}

WidgetModifierConfig aspectRatio(double value) {
Expand Down
Loading
Loading