GlassPathBridge class
Low-level FFI bridge for writing path data to native glass mask.
This bridge manages shared memory between Flutter and native code. Flutter writes path commands/points, native reads and applies as mask.
Thread safety:
- frameIdPost is written FIRST (signals write in progress)
- All data is written
- frameId is written LAST (signals write complete)
- Native reads frameId, copies data, reads frameIdPost
- If frameId != frameIdPost, native skips frame (torn read)
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isAvailable → bool
-
Whether the bridge is available.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
createBuffer(
String windowId, {int layerId = 0}) → bool - Create a path buffer for a window and layer. Returns true if successful.
-
destroyAllBuffers(
String windowId) → void - Destroy all path buffers for a window.
-
destroyBuffer(
String windowId, {int layerId = 0}) → void - Destroy the path buffer for a window and layer.
-
hasBuffer(
String windowId, {int layerId = 0}) → bool - Check if a buffer exists for a window and layer.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setDark(
String windowId, bool isDark, {int layerId = 0}) → void - Set dark mode for a window and layer.
-
setEnabled(
String windowId, bool enabled) → void - Enable glass effect for a window.
-
setMaterial(
String windowId, int material, {int layerId = 0}) → void - Set the blur material for a window and layer.
-
setTintOpacity(
String windowId, double opacity, {double cornerRadius = 16, int layerId = 0}) → void -
Set tint opacity for a window's glass effect.
A dark tint layer is added behind the glass to reduce transparency.
opacity: 0.0 = fully transparent (default), 1.0 = fully opaque blackcornerRadius: Corner radius for the tint layer (default 16) -
toString(
) → String -
A string representation of this object.
inherited
-
writePath(
{required String windowId, required List< GlassPathCommand> commands, required List<double> points, required double windowHeight, int layerId = 0}) → void - Write raw path commands and points to the buffer.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance → GlassPathBridge
-
no setter