Skip to main content

streamdeck_flutter 0.5.1 copy "streamdeck_flutter: ^0.5.1" to clipboard
streamdeck_flutter: ^0.5.1 copied to clipboard

PlatformmacOS

Build Elgato Stream Deck plugins with Flutter. Renders UI offscreen, slices frames into key-sized tiles, and pushes them via the Stream Deck WebSocket protocol.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:streamdeck_flutter/streamdeck_flutter.dart';
import 'package:streamdeck_flutter_example/logger.dart';
import 'package:streamdeck_flutter_example/widgets/animation_key.dart';
import 'package:streamdeck_flutter_example/widgets/dial_driven_animation.dart';
import 'package:streamdeck_flutter_example/widgets/hello_world.dart';
import 'package:streamdeck_flutter_example/widgets/panorama.dart';
import 'package:streamdeck_flutter_example/widgets/tapper.dart';

const _binaryName = 'streamdeck_flutter_example';
const _uuid = 'com.example.flutter';

const _defaultColors = [
  Color(0xFFE53935),
  Color(0xFF8E24AA),
  Color(0xFF1E88E5),
  Color(0xFF43A047),
  Color(0xFFFB8C00),
  Color(0xFF00ACC1),
  Color(0xFF7CB342),
  Color(0xFFD81B60),
];

void main(List<String> args) {
  initLogging();
  runStreamDeckPlugin(args, manifest: _manifest);
}

Color _colorFor(BuildContext context) {
  final ac = StreamDeck.actionOf(context)!;
  final hex = ac.payload.setting<String>('color');
  if (hex != null && hex.length == 6) {
    final value = int.tryParse(hex, radix: 16);
    if (value != null) return Color(0x000000 | value);
  }
  return _defaultColors[ac.context.hashCode.abs() % _defaultColors.length];
}

final _manifest = Manifest(
  uuid: _uuid,
  author: 'streamdesk',
  name: 'streamdesk flutter',
  description: 'Flutter-powered Stream Deck plugin with live keys and encoder dials',
  category: 'streamdesk flutter',
  categoryIcon: 'assets/imgs/plugin-icon',
  icon: 'assets/imgs/marketplace',
  version: '0.4.0.0',
  codePath: '$_binaryName.app/Contents/MacOS/$_binaryName',
  codePathMac: '$_binaryName.app/Contents/MacOS/$_binaryName',
  os: const [ManifestOS(platform: 'mac', minimumVersion: '12')],
  software: const ManifestSoftware(minimumVersion: '6.9'),
  actions: [
    ManifestAction(
      id: 'tapper',
      name: 'Tapper',
      tooltip: 'Tracks daily intake from a REST endpoint with remaining/used display and dose logging.',
      icon: 'assets/imgs/tapper-image',
      propertyInspectorPath: 'assets/ui/tapper.html',
      encoder: const ManifestEncoder(
        triggerDescription: ManifestTriggerDescription(
          rotate: 'Adjust dose',
          push: 'Log dose',
          touch: 'Toggle display',
        ),
      ),
      states: const [ManifestState(image: 'assets/imgs/tapper-image')],
      builder: (context) => TapperAction(),
    ),
    ManifestAction(
      id: 'animation',
      name: 'Animation',
      tooltip: 'Animated key/dial with 8 styles. Press or tap to cycle. Dial rotate adjusts speed.',
      icon: 'assets/imgs/animation',
      encoder: const ManifestEncoder(
        triggerDescription: ManifestTriggerDescription(
          rotate: 'Adjust speed',
          push: 'Next animation',
          touch: 'Next animation',
        ),
      ),
      states: [ManifestState(image: 'assets/imgs/bounce', title: 'Bounce')],
      builder: (context) => AnimationKey(defaultColor: _colorFor(context)),
    ),
    ManifestAction(
      id: 'dial-driven',
      name: 'Dial Driven',
      tooltip: 'Animation driven by dial rotation. Rotate to scrub, press to toggle auto-play.',
      icon: 'assets/imgs/dial_rotate',
      encoder: const ManifestEncoder(
        triggerDescription: ManifestTriggerDescription(
          rotate: 'Scrub animation',
          push: 'Play / Pause',
          touch: 'Play / Pause',
        ),
      ),
      states: const [ManifestState(title: 'Dial', image: 'assets/imgs/dial_rotate')],
      builder: (context) => DialDrivenAnimation(color: _colorFor(context)),
    ),
    ManifestAction(
      id: 'hello-world',
      name: 'Hello World',
      tooltip: 'A simple tap counter. Press key or rotate dial to count, press dial or touch to reset.',
      icon: 'assets/imgs/hello_world',
      encoder: const ManifestEncoder(
        triggerDescription: ManifestTriggerDescription(rotate: 'Count', push: 'Reset', touch: 'Reset'),
      ),
      states: const [ManifestState(image: 'assets/imgs/hello_world')],
      builder: (context) => HelloWorldAction(),
    ),
    ManifestAction(
      id: 'panorama',
      name: 'Panorama',
      tooltip:
          'Device-wide animation that pans across the whole panel. Drop it on every key and dial; '
          'pick Aurora, Starfield, Pulse, or Calibration in the inspector.',
      icon: 'assets/imgs/animation',
      states: const [ManifestState(image: 'assets/imgs/animation')],
      controllers: const [.keypad, .encoder],
      propertyInspectorPath: 'assets/ui/panorama.html',
      builder: (context) => const PanoramaAction(),
    ),
  ],
);
0
likes
150
points
51
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Build Elgato Stream Deck plugins with Flutter. Renders UI offscreen, slices frames into key-sized tiles, and pushes them via the Stream Deck WebSocket protocol.

Repository (GitHub)
View/report issues

Topics

#streamdeck #elgato #macos #plugin

License

BSD-3-Clause (license)

Dependencies

args, flutter, freezed_annotation, image, json_annotation, logging, rxdart, standard_message_codec, streamdeck_client

More

Packages that depend on streamdeck_flutter

Packages that implement streamdeck_flutter