دوال الأشكال
الدوال الحرة التي تستخدمها المُصيّرات لقص مسار العدسة ورسمه. مُصدَّرة لأن نصفي المكتبة يحتاجانها، ونادراً ما تستدعيها بنفسك.
liquidGlassClip
functionliquidGlassClipCornerRadius
functionliquidGlassCornerStyle
functionliquidGlassUsesRoundedClip
functionliquidGlassCornerSegments
functionliquidGlassSquirclePath
functionliquidGlassContinuousRoundedRectPath
liquidGlassClip#
Wraps child in the clip that matches shape's outline, honoring its LiquidGlassShape.clipQuality: a circular ClipRRect, a shader-matched squircle ClipPath, or an Apple capsule-style continuous ClipPath. Used by the renderers so the clipped blur/child silhouette agrees with the SDF the shader draws.
التوقيع
liquidGlassClip({ required LiquidGlassShape shape, required Widget child, Offset shapeScale = const Offset(1, 1), })| المعامل | النوع | الافتراضي | الوصف |
|---|---|---|---|
shapeمطلوب | LiquidGlassShape | — | |
childمطلوب | Widget | — | |
shapeScale | Offset | const Offset(1, 1) |
معرَّف في lib/src/widgets/utils/liquid_glass_shape.dart
liquidGlassClipCornerRadius#
The corner radius used to clip a lens to its outline.
التوقيع
liquidGlassClipCornerRadius(LiquidGlassShape shape)| المعامل | النوع | الافتراضي | الوصف |
|---|---|---|---|
shape | LiquidGlassShape | — |
معرَّف في lib/src/widgets/utils/liquid_glass_shape.dart
liquidGlassCornerStyle#
The shader corner-style selector (u_cornerStyle), derived from LiquidGlassShape.cornerStyle:
2.0— Apple capsule-style (LiquidGlassCornerStyle.continuous).1.0— L^n squircle (LiquidGlassCornerStyle.squircle, full smoothing).0.0— plain circular (LiquidGlassCornerStyle.circular).
التوقيع
liquidGlassCornerStyle(LiquidGlassShape shape)| المعامل | النوع | الافتراضي | الوصف |
|---|---|---|---|
shape | LiquidGlassShape | — |
معرَّف في lib/src/widgets/utils/liquid_glass_shape.dart
liquidGlassUsesRoundedClip#
Whether the shape uses a rounded clip for its blur-backdrop and child clips. Every LiquidGlassShape is a rounded-rectangle family shape, so this is always true — kept as a named predicate for the renderers' call sites.
التوقيع
liquidGlassUsesRoundedClip(LiquidGlassShape shape)| المعامل | النوع | الافتراضي | الوصف |
|---|---|---|---|
shape | LiquidGlassShape | — |
معرَّف في lib/src/widgets/utils/liquid_glass_shape.dart
liquidGlassCornerSegments#
Tessellation density for a corner of on-screen reach — shared by both curved corner styles. A corner spans 2 × this many straight segments.
reach is the corner's actual extent — the continuous curve's r · (1 + slack), the squircle's zone — NOT its radius. A stretched corner covers more ground per step than a round one of the same radius, and keying this on r alone lets an extreme aspect ratio slip past the budget (measured: 600×24 at r 12 strayed 0.052 px).
Inverts the sagitta law for the clip's error budget (0.05 logical px), so a small pill is not tessellated to the same density as a full-screen card. Floored at 3 so even a hairline radius keeps a curve, and capped at 40.
التوقيع
liquidGlassCornerSegments(double reach)| المعامل | النوع | الافتراضي | الوصف |
|---|---|---|---|
reach | double | — |
معرَّف في lib/src/widgets/utils/liquid_glass_shape.dart
liquidGlassSquirclePath#
The continuous-curvature (squircle) outline — the SAME L^n superellipse the shader draws. zone and n are derived exactly like continuousCornerParams in liquid_glass_common.glsl, so the clip lines up with the refraction.
التوقيع
liquidGlassSquirclePath(Size size, double r, double smoothing, { int? seg, double renderScale = 1.0, })| المعامل | النوع | الافتراضي | الوصف |
|---|---|---|---|
size | Size | — | |
r | double | — | |
smoothing | double | — | |
seg | int? | — | |
renderScale | double | 1.0 |
معرَّف في lib/src/widgets/utils/liquid_glass_shape.dart
liquidGlassContinuousRoundedRectPath#
The capsule-style continuous rounded-rectangle outline: each corner is a p-norm ball whose box is stretched along whichever edge has room, with an exponent that rises with that same room. The stretch is what makes the corner read as continuous — the curve leaves the edge at r · (1 + 0.2893) with zero tangent and curvature, instead of turning in at r.
This is the Dart twin of the shader's continuousRoundedRect* SDF, so the LiquidGlassClipQuality.continuous clip lines up with the refraction.
Both the reach and the exponent ramp with each edge's slack, so a square at full radius collapses to a clean circle and a capsule keeps a circular end cap while its long flank stays smoothed.
التوقيع
liquidGlassContinuousRoundedRectPath(Size size, double r, { int? seg, double renderScale = 1.0, })| المعامل | النوع | الافتراضي | الوصف |
|---|---|---|---|
size | Size | — | |
r | double | — | |
seg | int? | — | |
renderScale | double | 1.0 |
معرَّف في lib/src/widgets/utils/liquid_glass_shape.dart
التعليقات
التعليقات هي مناقشات GitHub — يمكنك الرد من أيٍّ من المكانين.