9564096a5c0ba95c5bcf63f67b8f5ac80599dc21
CI / quality (push) Failing after 5m56s
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
holo_shiny
holo_shiny is a Flutter package that renders shader-driven holographic shine.
It exposes two widget layers:
Shiny: apply shine to any widget (no clipping and no rotation)ShinyCard: card-oriented convenience widget with shape clipping and tilt rotation
Features
- GLSL shader-driven holographic effects
- Optional motion input via sensors or custom tilt stream
- Position-driven rendering: visuals respond to tilt/input position with no internal time animation
- Generic wrapper API for any widget via
Shiny(child: ...) - Card API with
background,foreground,shape, and drag tilt viaShinyCard - Four specialized material profiles backed by dedicated shader assets
- Global shader opacity control via
opacity - Cross-platform Flutter support (mobile, web, desktop)
Installation
Add the package:
dependencies:
holo_shiny: ^0.1.0
Then run:
flutter pub get
Quick Start
import 'package:flutter/material.dart';
import 'package:holo_shiny/holo_shiny.dart';
class Demo extends StatelessWidget {
const Demo({super.key});
@override
Widget build(BuildContext context) {
return const Shiny(
child: ColoredBox(
color: Color(0xFF202A3A),
child: SizedBox(width: 280, height: 80),
),
);
}
}
Card Usage
ShinyCard(
controller: controller,
background: Container(color: const Color(0xFF1B2D4B)),
foreground: const Center(child: Text('HOLO')),
profile: ShinyProfile.crackedIce,
opacity: 1.0,
)
Motion with Controller
final ShinyController controller = ShinyController(useSensor: true);
Shiny(
controller: controller,
child: Container(color: const Color(0xFF1B2D4B)),
)
Profiles
Choose a precompiled material profile:
ShinyCard(
profile: ShinyProfile.holographicSilver,
)
ShinyCard(
profile: ShinyProfile.superGoldVinyl,
)
You can also provide a custom stream:
final StreamController<Offset> input = StreamController<Offset>.broadcast();
final ShinyController controller = ShinyController(tiltStream: input.stream);
API Summary
Shiny: generic effect wrapperShinyCard: shape + rotation + composition convenience widgetShinyProfile: specialized material presets mapped to dedicated shader assetsShinyController: optional source selection for tiltSensorTiltController: low-level sensor fusion stream utility
Important defaults:
profiledefaults toShinyProfile.crackedIceopacitydefaults to1.0
Platform Notes
- Shader uses Flutter runtime effects and avoids derivative functions (
dFdx,dFdy,fwidth) for web compatibility. - Shader output is deterministic for a given input state and is driven by tilt/position values instead of a ticking time uniform.
- If a sensor is unavailable, motion input simply emits no events.
Example
See the package example app in example/ for:
- Basic usage
- Any-widget shiny wrapper usage
- Sensor-driven motion
- External stream override
- Custom card shape/background/foreground composition
- Profile switching in the demo UI
Publishing Notes
Replace placeholder package metadata URLs in pubspec.yaml before publishing.
Description
Languages
Dart
60.9%
GLSL
38.9%
Kotlin
0.2%