### Dashbook Example Information (Info Parameter) Source: https://pub.dev/packages/dashbook Provide instructions or relevant information for an example using the 'info' parameter in the 'add' method. This information appears in a side toolbar icon. ```dart final dashbook = Dashbook(); dashbook .storiesOf('CustomDialog') .add('default', (ctx) { ctx.action('Open dialog', (context) { showDialog( context: context, builder: (_) => CustomDialog(), ); }); return SizedBox(); }, info: 'Use the actions button on the side to show the dialog.', ); ``` -------------------------------- ### Dashbook Example Information (PinInfo Parameter) Source: https://pub.dev/packages/dashbook Directly display example information in the preview area by setting 'pinInfo' to true. This removes the need for the user to click an icon to see the information. ```dart final dashbook = Dashbook(); dashbook .storiesOf('CustomDialog') .add('default', (ctx) { // omitted ... }, info: 'Use the actions button on the side to show the dialog.', pinInfo: true, ); ``` -------------------------------- ### Dashbook Dependency in pubspec.yaml Source: https://pub.dev/packages/dashbook/install This is an example of how the dashbook dependency will appear in your pubspec.yaml file after running the add command. ```yaml dependencies: dashbook: ^0.1.17 ``` -------------------------------- ### Dashbook Actions for User Interaction Source: https://pub.dev/packages/dashbook Use Dashbook actions to call methods from its UI, enabling user interaction for complex examples like showing dialogs. The action callback receives the BuildContext. ```dart final dashbook = Dashbook(); dashbook .storiesOf('CustomDialog') .add('default', (ctx) { ctx.action('Open dialog', (context) { showDialog( context: context, builder: (_) => CustomDialog(), ); }); return SizedBox(); }); ``` -------------------------------- ### Import Dashbook in Dart Code Source: https://pub.dev/packages/dashbook/install Import the dashbook library into your Dart files to start using its features for widget showcasing. ```dart import 'package:dashbook/dashbook.dart'; ``` -------------------------------- ### Initialize Dashbook with Dual Themes Source: https://pub.dev/packages/dashbook Use the `dualTheme` constructor when your app has two themes (light and dark). The `initWithLight` parameter determines the initial theme. ```dart final dashbook = Dashbook.dualTheme( light: YourLightTheme(), dark: YourDarkTheme(), ); ``` -------------------------------- ### Initialize Dashbook with Dual Theme Source: https://pub.dev/packages/dashbook/example This snippet shows how to initialize Dashbook with both light and dark themes, set a title, and enable auto-pinning of stories on large screens. Ensure you have imported the necessary packages. ```dart import 'package:dashbook/dashbook.dart'; import 'package:example/stories.dart'; import 'package:example/text_story.dart'; import 'package:flutter/material.dart'; void main() { final dashbook = Dashbook.dualTheme( light: ThemeData(), dark: ThemeData.dark(), title: 'Dashbook Example', autoPinStoriesOnLargeScreen: true, ); addTextStories(dashbook); addStories(dashbook); runApp(dashbook); } ``` -------------------------------- ### Initialize Dashbook with a Single Theme Source: https://pub.dev/packages/dashbook Use the default Dashbook constructor with the optional `theme` parameter to set a single theme for your app. ```dart final dashbook = Dashbook(theme: ThemeData()); ``` -------------------------------- ### Initialize Dashbook with Multiple Themes Source: https://pub.dev/packages/dashbook Use the `multiTheme` constructor for apps with more than two themes. Provide a map of theme names to `ThemeData` and optionally specify the `initialTheme`. ```dart final dashbook = Dashbook.multiTheme( themes: { 'theme1': Theme1(), 'theme2': Theme2(), 'theme3': Theme3(), } ); ``` -------------------------------- ### Basic Dashbook Usage Source: https://pub.dev/packages/dashbook Initialize Dashbook and add stories for widgets. Decorators can be used to apply common layouts to story chapters. Widgets can have multiple chapters, each with configurable properties. ```dart import 'package:flutter/material.dart'; import 'package:dashbook/dashbook.dart'; void main() { final dashbook = Dashbook(); // Adds the Text widget stories dashbook .storiesOf('Text') // Decorators are easy ways to apply a common layout to all of the story chapters, here are using onde of Dashbook's decorators, // which will center all the widgets on the center of the screen .decorator(CenterDecorator()) // The Widget story can have as many chapters as needed .add('default', (ctx) { return Container(width: 300, child: Text( ctx.textProperty("text", "Text Example"), textAlign: ctx.listProperty( "text align", TextAlign.center, TextAlign.values, ), textDirection: ctx.listProperty( "text direction", TextDirection.rtl, TextDirection.values, ), style: TextStyle( fontWeight: ctx.listProperty( "font weight", FontWeight.normal, FontWeight.values, ), fontStyle: ctx.listProperty( "font style", FontStyle.normal, FontStyle.values, ), fontSize: ctx.numberProperty("font size", 20)), )); }); dashbook .storiesOf('RaisedButton') .decorator(CenterDecorator()) .add('default', (ctx) => RaisedButton(child: Text('Ok'), onPressed: () {})); // Since dashbook is a widget itself, you can just call runApp passing it as a parameter runApp(dashbook); } ``` -------------------------------- ### Add Dashbook Dependency Source: https://pub.dev/packages/dashbook Add the Dashbook dependency to your pubspec.yaml file. ```yaml flutter pub add dashbook ``` -------------------------------- ### Add Dashbook Dependency Source: https://pub.dev/packages/dashbook/install Use this command to add dashbook to your Flutter project's dependencies. It automatically updates your pubspec.yaml file. ```bash $ flutter pub add dashbook ``` -------------------------------- ### Control Property Visibility in Stories Source: https://pub.dev/packages/dashbook Use `visibilityControlProperty` within `colorProperty` or other property definitions to conditionally show properties based on another property's value. This helps manage complex widgets with many customizable fields. ```dart dashbook.storiesOf('MessageCard').decorator(CenterDecorator()).add( 'default', (ctx) => MessageCard( message: ctx.textProperty('message', 'Some cool message'), type: ctx.listProperty('type', MessageCardType.info, MessageCardType.values), errorColor: ctx.colorProperty( 'errorColor', const Color(0xFFCC6941), // this property will only be shown when type is error visibilityControlProperty: ControlProperty('type', MessageCardType.error), ), infoColor: ctx.colorProperty( 'infoColor', const Color(0xFF5E89FF), // this property will only be shown when type is info visibilityControlProperty: ControlProperty('type', MessageCardType.info), ), ), ); ``` -------------------------------- ### Deprecated `activeColor` Usage Source: https://pub.dev/packages/dashbook/score This snippet highlights a deprecated property `activeColor` in a Flutter widget. It suggests using `activeThumbColor` instead. The warning is typically shown during static analysis. ```dart activeColor: Colors.blue, ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.