### Install StageCraft (Shell) Source: https://github.com/robiness/stage_craft/blob/main/README.md Shows the command-line interface command to add StageCraft to a Flutter project. ```shell flutter pub add stage_craft ``` -------------------------------- ### Flutter Development Commands Source: https://github.com/robiness/stage_craft/blob/main/CLAUDE.md Common commands for running tests, static analysis, dependency management, and executing the example application. ```bash flutter test flutter test test/controls/value_control_test.dart flutter analyze flutter pub get cd example && flutter run ``` -------------------------------- ### Install StageCraft (YAML) Source: https://github.com/robiness/stage_craft/blob/main/README.md Demonstrates how to add StageCraft as a dependency in a Flutter project's pubspec.yaml file. ```yaml dependencies: stage_craft: ^1.0.0 ``` -------------------------------- ### Minimal StageCraft Example (Dart) Source: https://github.com/robiness/stage_craft/blob/main/README.md A basic Flutter application showcasing StageCraft's core functionality. It includes a custom widget ('MyWidget') and a StageBuilder to control its properties (text and color) in real-time. ```dart import 'package:flutter/material.dart'; import 'package:stage_craft/stage_craft.dart'; Future main() async { runApp(const MinimalExample()); } /// Your App or ui playground project class MinimalExample extends StatelessWidget { const MinimalExample({super.key}); @override Widget build(BuildContext context) { return MaterialApp( home: Scaffold( body: MinimalExampleStage(), ), ); } } /// The Stage for your widget class MinimalExampleStage extends StatelessWidget { MinimalExampleStage({super.key}); final textControl = StringControl(label: 'text', initialValue: 'Hello!'); final colorControl = ColorControl(label: 'color', initialValue: Colors.blue); @override Widget build(BuildContext context) { return StageBuilder( controls: [textControl, colorControl], builder: (context) { return MyWidget( color: colorControl.value, text: textControl.value, ); }, ); } } /// Your actual widget class MyWidget extends StatelessWidget { const MyWidget({ super.key, required this.color, required this.text, }); final Color color; final String text; @override Widget build(BuildContext context) { return ColoredBox( color: color, child: Text( text, style: Theme.of(context).textTheme.titleLarge, ), ); } } ``` -------------------------------- ### Widget Testing with Spot Package Source: https://github.com/robiness/stage_craft/blob/main/CLAUDE.md Key patterns and helper functions used for widget testing with the 'spot' package, facilitating efficient testing of controls and widgets. ```dart // Helper for testing controls by pumping the widget tree // await tester.pumpControl(); // Helper for finding controls within tests // spotControl() // Test coverage focuses on control validation, null handling, and value persistence. ``` -------------------------------- ### Analysis Configuration Source: https://github.com/robiness/stage_craft/blob/main/CLAUDE.md Configuration for static analysis and linting, specified in the analysis_options.yaml file. Enforces rules like public member API documentation. ```yaml analyzer: plugins: - flutter_lints errors: # Ensure public members have API docs public_member_api_docs: ignore # Other linting rules can be configured here ``` -------------------------------- ### Stage System Components Source: https://github.com/robiness/stage_craft/blob/main/CLAUDE.md Core components of the Stage System responsible for creating the widget staging environment, including the canvas, controllers, and styling. ```dart // lib/src/stage/stage.dart // Main widget that creates a stage environment with controls sidebar class StageBuilder extends StatelessWidget { ... } // Interactive canvas where widgets are displayed and manipulated class StageCanvas extends StatefulWidget { ... } // Controls zoom, rulers, crosshair, text scaling class StageCanvasController { ... } // Positioning and constraint handling for staged widgets class StageRect { ... } // Sidebar containing all widget controls // import 'control_bar.dart'; // Theming and visual styling system // import 'stage_style.dart'; ``` -------------------------------- ### Control System Components Source: https://github.com/robiness/stage_craft/blob/main/CLAUDE.md Components of the Control System, including abstract base classes and concrete implementations for widget parameter controls, and grouping mechanisms. ```dart // lib/src/controls/value_control.dart // Abstract base class for all widget parameter controls abstract class ValueControl extends ValueNotifier { ... } // Concrete implementations for various data types // class BoolControl extends ValueControl { ... } // class StringControl extends ValueControl { ... } // class IntControl extends ValueControl { ... } // class DoubleControl extends ValueControl { ... } // class ColorControl extends ValueControl { ... } // Groups related controls together // class ControlGroup { ... } // Each control provides a builder() method returning a widget for the control sidebar ``` -------------------------------- ### Flutter Web Service Worker Loading Source: https://github.com/robiness/stage_craft/blob/main/example/web/index.html This JavaScript code snippet is responsible for loading the main Dart entry point for a Flutter web application. It configures the service worker and initializes the Flutter engine, ultimately running the application. It relies on the `_flutter.loader` object provided by the Flutter build process. ```javascript var serviceWorkerVersion = null; window.addEventListener('load', function(ev) { // Download main.dart.js _flutter.loader.loadEntrypoint({ serviceWorker: { serviceWorkerVersion: serviceWorkerVersion, }, onEntrypointLoaded: function(engineInitializer) { engineInitializer.initializeEngine().then(function(appRunner) { appRunner.runApp(); }); } }); }); ``` -------------------------------- ### Widget Layer Components Source: https://github.com/robiness/stage_craft/blob/main/CLAUDE.md Custom UI components used within the StageCraft environment, such as color pickers and text fields, designed for the stage interface. ```dart // lib/src/widgets/stage_craft_color_picker.dart class StageCraftColorPicker extends StatefulWidget { ... } // lib/src/widgets/stage_craft_text_field.dart class StageCraftTextField extends StatelessWidget { ... } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.