Giter VIP home page Giter VIP logo

storybook_flutter's People

Contributors

buehler avatar davidrg13 avatar fox32 avatar happyemu avatar jeroen-meijer avatar kirpal avatar maksymilian-majer avatar maxim-filimonov avatar murilodag avatar ookami-kb avatar tenhobi avatar thabata-marchi avatar witwash avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

storybook_flutter's Issues

Lower dependency on recase

I use artemis in my project and it depends on recase ^2. I tried to downgrade recase dependency manually here and it worked. Any reason it need to be 3?

Unsupported operation: Undetermined Nullability with storybook 0.5.0 (or master) and flutter stable

Hello, i'm trying to upgrade to v0.5, but i get a weird exception when launching my storybook on chrome.
I get the same error when i try to launch the example of this repo (packages/storybook_flutter/example) and this is the stacktrace :

> example git:(master) ✗ flutter run -d chrome
Running "flutter pub get" in example...                          1 277ms
Launching lib/main.dart on Chrome in debug mode...
Waiting for connection from debug service on Chrome...          
Unhandled exception:
Unsupported operation: Undetermined Nullability
#0      ProgramCompiler._emitFutureOrType (package:dev_compiler/src/kernel/compiler.dart:2857:7)
#1      ProgramCompiler._normalizeFutureOr (package:dev_compiler/src/kernel/compiler.dart:2730:12)
#2      ProgramCompiler.visitFutureOrType (package:dev_compiler/src/kernel/compiler.dart:2739:7)
#3      FutureOrType.accept (package:kernel/ast.dart:9269:42)
#4      ProgramCompiler._emitType (package:dev_compiler/src/kernel/compiler.dart:2655:54)
#5      ProgramCompiler._emitTypeNames (package:dev_compiler/src/kernel/compiler.dart:3048:56)
#6      ProgramCompiler.visitFunctionType (package:dev_compiler/src/kernel/compiler.dart:2937:24)
#7      ProgramCompiler._emitFunctionTagged (package:dev_compiler/src/kernel/compiler.dart:2611:19)
#8      ProgramCompiler.visitFunctionExpression (package:dev_compiler/src/kernel/compiler.dart:5866:12)
#9      FunctionExpression.accept (package:kernel/ast.dart:6735:44)
#10     ProgramCompiler._visitExpression (package:dev_compiler/src/kernel/compiler.dart:3623:20)
#11     ProgramCompiler._emitArgumentList (package:dev_compiler/src/kernel/compiler.dart:5315:11)
#12     ProgramCompiler._emitMethodCall (package:dev_compiler/src/kernel/compiler.dart:4633:16)
#13     ProgramCompiler.visitInstanceInvocation (package:dev_compiler/src/kernel/compiler.dart:4558:12)
#14     InstanceInvocation.accept (package:kernel/ast.dart:4536:44)
#15     ProgramCompiler._visitExpression (package:dev_compiler/src/kernel/compiler.dart:3623:20)
#16     ProgramCompiler.visitReturnStatement (package:dev_compiler/src/kernel/compiler.dart:4152:38)
#17     ReturnStatement.accept (package:kernel/ast.dart:7786:43)
#18     ProgramCompiler._visitStatement (package:dev_compiler/src/kernel/compiler.dart:3551:20)
#19     ProgramCompiler._emitFunctionScopedBody (package:dev_compiler/src/kernel/compiler.dart:3562:18)
#20     ProgramCompiler._emitSyncFunctionBody.<anonymous closure> (package:dev_compiler/src/kernel/compiler.dart:3355:17)
#21     ProgramCompiler._withLetScope (package:dev_compiler/src/kernel/compiler.dart:2235:25)
#22     ProgramCompiler._withCurrentFunction (package:dev_compiler/src/kernel/compiler.dart:3389:18)
#23     ProgramCompiler._emitSyncFunctionBody (package:dev_compiler/src/kernel/compiler.dart:3351:17)
#24     ProgramCompiler._emitFunction (package:dev_compiler/src/kernel/compiler.dart:3165:11)
#25     ProgramCompiler._emitLibraryFunction (package:dev_compiler/src/kernel/compiler.dart:2591:14)
#26     MappedIterator.moveNext (dart:_internal/iterable.dart:389:20)
#27     new _GrowableList._ofOther (dart:core-patch/growable_array.dart:198:26)
#28     new _GrowableList.of (dart:core-patch/growable_array.dart:152:26)
#29     new List.of (dart:core-patch/array_patch.dart:50:28)
#30     Iterable.toList (dart:core/iterable.dart:366:12)
#31     ProgramCompiler._emitLibraryProcedures (package:dev_compiler/src/kernel/compiler.dart:2557:10)
#32     ProgramCompiler._emitLibrary (package:dev_compiler/src/kernel/compiler.dart:530:7)
#33     List.forEach (dart:core-patch/growable_array.dart:403:8)
#34     ProgramCompiler.emitModule (package:dev_compiler/src/kernel/compiler.dart:394:15)
#35     JavaScriptBundler.compile (package:frontend_server/src/javascript_bundle.dart:144:33)
<asynchronous suspension>
#36     FrontendCompiler.writeJavascriptBundle (package:frontend_server/frontend_server.dart:632:5)
<asynchronous suspension>
#37     FrontendCompiler.compile (package:frontend_server/frontend_server.dart:545:9)
<asynchronous suspension>
#38     listenAndCompile.<anonymous closure> (package:frontend_server/frontend_server.dart:1105:11)
<asynchronous suspension>
the Dart compiler exited unexpectedly.
Failed to compile application.

Waiting for connection from debug service on Chrome...             36,4s

I didn't have any problem lauching the v0.4.0 on the chrome device.
The v0.5.0 is working perfectly on my android device (and i really like the new ControlPanel).

Thank you for all your work on the storybook and i hope you can help me to get rid of this "Undetermined Nullability" ^^

> example git:(master) ✗ flutter doctor   
[✓] Flutter (Channel stable, 2.0.4, on Mac OS X 10.15.7 19H524 darwin-x64, locale fr-FR)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.1)
[✓] IntelliJ IDEA Ultimate Edition (version 2020.3.3)
[✓] VS Code (version 1.55.1)
[✓] Connected device (2 available)

Version solving failed (freezed_annotation)

When trying to depend on a recent version of storybook_flutter, I get the following error:

Because storybook_flutter >=0.9.0-dev.1 depends on freezed_annotation >=0.14.0 <2.0.0 and lifepal_app depends on freezed_annotation ^2.0.0, storybook_flutter >=0.9.0-dev.1 is forbidden.
So, because lifepal_app depends on storybook_flutter ^0.10.1, version solving failed.
pub get failed (1; So, because lifepal_app depends on storybook_flutter ^0.10.1, version solving failed.)

It would be great if storybook_flutter could support recent versions of freezed_annotation.

CupertinoApp

Hello, are there any plans of adding CupertinoApp inside Storybook?

[Proposal] Add Button knob

I'm running into a few situations where I need a button knob that executes a function on press.
Specifically, for state transitions and transient states such as animations.

Having a button knob would allow me to trigger and test animations and state transitions, among other functionality.

I'm willing to make a PR if you'd be willing to accept a button knob.

Add supportedLocales

Hi @ookami-kb,

I am using this library and would like to create a Pull request to add supportedLocales to the Storybook widget.

Can't erase text in text knob on macOS

Edit: Found a solution!

This problem can be solved by wrapping Storybook widget in a CupertinoApp:

class StorybookApp extends StatelessWidget {
  final ImageRepository imageRepository;

  const StorybookApp({Key? key, required this.imageRepository}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return ImageRepositoryWidget(
      imageRepository: imageRepository,
      child: CupertinoApp(
        home: Storybook(
          plugins: _getPlugins(),
          wrapperBuilder: cupertinoWrapper,
          stories: [
            getHighlightActionBar(),
            getHighlightSmallStory(),
          ],
        ),
      ),
    );
  }
}

Hi there!
I'm having a strange problem with text field knobs when building for macOS and android emulators on macOS.
When I try to erase a text in a text knob with backspace or delete, the text just won't change. I can write texts but can't erase them, can't move the cursor with the keyboard arrows either.

On web build it works just fine.

Is something missing in my project setup?

Thanks!

Code sample

import 'package:flutter/material.dart';
import 'package:storybook_flutter/storybook_flutter.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Storybook(
      stories: [
        Story(
          name: 'TestWidget',
          builder: (context) => Center(
            child: Text(
              context.knobs.text(
                label: 'Input text',
                initial: 'Default text',
              ),
            ),
          ),
        ),
      ],
    );
  }
}

Versions

  • Flutter: stable 2.10.2
  • macOS: 11.6
  • Dart: 2.16.1
  • storybook_flutter: 0.10.1+1

Flutter Doctor

[✓] Flutter (Channel stable, 2.10.2, on macOS 11.6 20G165 darwin-x64, locale en)
    • Flutter version 2.10.2 at /Users/vitorreda/Downloads/flutter 2
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 097d3313d8 (6 days ago), 2022-02-18 19:33:08 -0600
    • Engine revision a83ed0e5e3
    • Dart version 2.16.1
    • DevTools version 2.9.2

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/vitorreda/Library/Android/sdk
    • Platform android-31, build-tools 30.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.0)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2020.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)

[✓] Connected device (3 available)
    • SM N9600 (mobile) • 25fb3b8227047ece • android-arm64  • Android 10 (API 29)
    • macOS (desktop)   • macos            • darwin-x64     • macOS 11.6 20G165 darwin-x64
    • Chrome (web)      • chrome           • web-javascript • Google Chrome 98.0.4758.109

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

Update dependencies

dependencies are outdated and make it not possible to integrate with other project elements. Please update

Visualizing stories on device preview

Is there a way to visualize the stories using device preview?

I've tried to add this line to Storybook but the entire page gets wrapped inside device_preview, not only the storyh

 storyWrapperBuilder: (context, story, widget) =>
            DevicePreview.appBuilder(context, widget)

Discussion: Testing Features Support

Thank you for such a great library which I use heavily in all my projects.

Recently, I've setup golden_toolkit to automatically generate screenshots. However, this doesn't make sense if one is already using this library. The issue is that golden_toolkit requires extensive setup and is limited by widget test limitations. Since our UI is already storyboarded, it makes more sense to run tests from this library instead.

Do you have any plans to add testing features?
There are a few testing features I'm immediately interested in adding to storyboard:

  1. Automatically iterate through all stories and capture screenshots.
  2. Automatically generate different screensize previews.
  3. A knob options wrapper for automatically testing different scenarios of knob values. If the knob values are added to a map, they can be automatically iterated through to generate all the combinations of UI states.

What are your thoughts?

Add a knob to show layout explorer view

Not sure how complicated this is but would it be possible to add a know for something that we see in a layout explorer?

I am more interested in seeing margins and paddings.

image

Some context: We are hoping to give access to our Desingers pre-merge for custom widgets, so that they can play with them and make sure they are good before developers merge them.

Feature Request : Widget search bar

Hi!
First of all, thank you for this project
It helps easier a lot to manage all the widgets in the project :-)

But I'm facing that it is quite hard to find the widget if I have many widgets.
I have to scroll through all the lists to find the widget.
It would be helpful if there is a search bar at the navigator panel to find a widget.

Feature Request: Int return value for slider knob

Thanks for making this amazing package, it's a real big help :)

A small feature that would be nice to have is the ability to make the slider return an integer rather than double. It is possible to cast the value returned to an int, but making the slider capable of only returning integers would be nice. If you don't have much down time I'd be willing to implement this with guidance on how you'd like the API to look.

Thanks again for this package!

Cannot use knobs in MacOS

Flutter: 2.5.1
Storybook version: 0.7.0
OS: MacOS BigSur

Running storybook on MacOS results in unusable knobs.
Same sources works from Web

Hot reload not work in version 0.11.2+2 ?

same problem as #65 ,

storybook_fluter info:

storybook_flutter:
    dependency: "direct dev"
    description:
      name: storybook_flutter
      url: "https://pub.dartlang.org"
    source: hosted
    version: "0.11.2+2"

flutter info:

[✓] Flutter (Channel stable, 3.3.4, on macOS 12.6 21G115 darwin-x64, locale en-US)
    • Flutter version 3.3.4 on channel stable at /usr/local/Caskroom/flutter/3.0.5/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision eb6d86ee27 (11 days ago), 2022-10-04 22:31:45 -0700
    • Engine revision c08d7d5efc
    • Dart version 2.18.2
    • DevTools version 2.15.0

Join forces with dashbook?

Let's make one great flutter dev-tool instead of many!

Hi! first of all, I want to say that I really appreciate the works in this open-source project, I installed it and all other similar packages, and I think it can be great if the work is unified into a single tool which can become popular and a standard for flutter development.

I will list all the projects that I found here:

These 3 have the same goal, a storybookjs inspired package to showcase flutter widgets.

But there are also these projects that if combined with a flutter storybook, can really become a standard tool for every flutter developer:

I am pasting this same issue to all of these projects, if you don't want it, feel free to close it :D

Tell me what you think!

Hot reload?

Do you support hot reload?
It seems when I add a new story it only loads it after hot restart.

Nested Menu Structure

Hi @ookami-kb,

first of all thanks for your work!

It would be nice to have something like subsections for the menu.

Example:

  • Basic Components
    • Buttons
      • Primary Button
      • Secundary Button
    • etc.

Feature Request : Add code snippet in Story

First of all, thank your for this project.

It is easy to use, and nice to see.

Here is a feature request we might like for upcoming updates : Add a possibility to add a code snippet on a component Story

It would be great to see a minimum code to use to implement the demonstrated widget.

Image from widget not shown

Hi, there

Recently i tried to use story book to present components and found there is a image assets issue.

There is a component Rating as:

class Rating extends StatelessWidget {
  double iconSize;
  double spacing;
  int rating;

  Rating(this.rating, {this.iconSize = 32, this.spacing = 4});

  @override
  Widget build(BuildContext context) {
    return Row(
      children: List.generate(5, (index) {
        return SizedBox(
            width: iconSize.convert(),
            height: iconSize.convert(),
            child: Image.asset(
              index < rating
                  ? "assets/images/icon_star_selected.png"
                  : "assets/images/icon_star.png",
              fit: BoxFit.contain,
            ));
      }),
    );
  }
}

And i tried to present the rating inside story book as:

 Story(
              name: 'Widgets/Rating',
              description: 'Rating widget.',
              builder: (context) => Container(
                    child:  Rating(3) // all the images not shown
                  )
        )

All images inside Rating widget not shown.

My flutter env:

[✓] Flutter (Channel stable, 3.0.1, on macOS 12.1 21C52 darwin-x64, locale en-CN)
[!] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.
[!] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    ! CocoaPods 1.10.1 out of date (1.11.0 is recommended).
        CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/platform-plugins
      To upgrade see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.2)
[✓] IntelliJ IDEA Community Edition (version 2022.1.2)
[✓] VS Code (version 1.67.2)
[✓] Connected device (2 available)
    ! Error: 明棣的iPad is not connected. Xcode will continue when 明棣的iPad is connected. (code -13)
    ! Error: iPad-GG7DJ7P1Q16T is not connected. Xcode will continue when iPad-GG7DJ7P1Q16T is connected. (code -13)
    ! Error: 明棣’s iPad Air 4th is not connected. Xcode will continue when 明棣’s iPad Air 4th is connected. (code -13)
[✓] HTTP Host Availability

Please help to check this issue, tks!

Expose App `localizationsDelegates` property

Would it make any sense to expose this App localizationsDelegates in Storybook?

We are using FlutterI18n and have some widgets configured to use translations, making it impossible for us to use storybook for those widgets.

Great project!

Hot reload not work

flutter doctor -v

[✓] Flutter (Channel stable, 2.8.1, on macOS 12.1 21C52 darwin-x64, locale en-GB)
    • Flutter version 2.8.1 at /Users/yehorh/opt/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 77d935af4d (4 weeks ago), 2021-12-16 08:37:33 -0800
    • Engine revision 890a5fca2e
    • Dart version 2.15.1

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/yehorh/Library/Android/sdk
    • Platform android-31, build-tools 30.0.3
    • Java binary at: /Users/yehorh/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/203.7935034/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2020.3)
    • Android Studio at /Users/yehorh/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/203.7935034/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)

[✓] IntelliJ IDEA Ultimate Edition (version 2021.3.1)
    • IntelliJ at /Users/yehorh/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/213.6461.79/IntelliJ IDEA.app
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] IntelliJ IDEA Ultimate Edition (version 2021.3)
    • IntelliJ at /Users/yehorh/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/213.5744.223/IntelliJ IDEA.app
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.63.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.32.0

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-x64     • macOS 12.1 21C52 darwin-x64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 96.0.4664.110

package version:

storybook_flutter: ^0.9.0

steps to reproduce:
change a story name or a widget inside the Storybook widget and save for hot reload.

import 'package:flutter/material.dart';
import 'package:storybook_flutter/storybook_flutter.dart';

void main() {
  runApp(const StoryBookApp());
}

class StoryBookApp extends StatelessWidget {
  const StoryBookApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Storybook(
        stories: [
          Story(
            name: 'Test widget',
            description: 'Simple text widget',
            builder: (context) => const Center(child: Text('Simple text')),
          ),
        ],
      );
  }
}

Feature request: online demo

First, I think it is a great idea to make create such package for Flutter (reserved name is great through :) What about publishing online demo (for example, into GitHub pages)? In my opinion, it is easier for new users to see all features in packages which have online demos. In this case they do not need to clone/build package and can see it working in one single click.

Also, I think, it would be quite simple to publish online demo to GitHub pages if you already have an example.

Demo code no longer works

We tried setting up the repository in our project, but we get error:

The named parameter 'stories' isn't defined.
Try correcting the name to an existing named parameter's name, or defining a named parameter with the name 'stories'.dart[undefined_named_parameter](https://dart.dev/diagnostics/undefined_named_parameter)

image

We basically just followed the readme and then got the error. When then also tried copying over the demo code 1:1 and got the same error.

Some knobs fields stopped working

Flutter stable 2.8.1

Cant select knobs parameters after update to 0.10.0.
Example, options selector are inactive.
image

Another possibly related issue is when I change the text in textfield

Freezed update

Hi, @ookami-kb

Could you be so kind to update the version of freezed you are using?

Currently I'm getting this error:
storybook_flutter 0.7.0+1 depends on freezed_annotation ^0.14.1

This is quite an old feature (current is 1.0.0) and it will be nice to have the most up to date on! Thanks in advance!

Default light/dark theme inside initialDeviceFrameData

Phone simulator shown always starts in dark mode:
initialDeviceFrameData: DeviceFrameData( device: Devices.ios.iPhone13Mini, isFrameVisible: true, )
It would be great to be able to choose between light/dark themes by default. Is this possible?

BuildContext missing up-stream providers

After upgrading to the latest release, all my Object.of(context) where Object is Navigator or whatever, are returning nulls. It's like the BuildContext property of Story child/descendent widgets are getting contexts that haven't originated above the Story.

I validated this by explicitly passing contexts through tap handlers.

This is breaking BlocProviders, Navigators, etc.

Cupertino Theme instead of Custom Theme

Hi,

I'm trying to use a Custom Theme by adding the theme to the Storybook like this:

Widget build(BuildContext context) => Storybook(
        theme: CustomTheme.gmOneTheme,
        children: [
          Story(
            name: 'Primary Button',
            section: 'Buttons/Toggles',
            wrapperBuilder: (context, story, child) => Container(
              child: Center(child: child),
            ),
            builder: (context, k) => ElevatedButton(
              onPressed:
                  k.boolean(label: 'Enabled', initial: true) ? () {} : null,
              child: Text(
                k.text(label: 'Text', initial: 'Sign In'),
              ),
            ),
          ),
        ],
      );

It uses that theme in the emulator:
image

But on an android device, it uses the Cupertino app theme for the button styling instead:
image

How do I make sure that it's always using the custom theme that I've defined?

Not working context.knobs.sliderInt

storybook_flutter: ^0.10.0+1
sample

    return Story(
      name: 'Screens/Scaffold0',
      description: 'Story with scaffold and different knobs..',
      builder: (context) {
        return Scaffold(
            body: SizedBox(
          width: double.infinity,
          child: context.knobs.options<Widget>(
            label: 'Parent',
            initial: Column(
                children: List.generate(
              context.knobs.sliderInt(
                label: 'Items count Column',
                initial: 2,
                min: 1,
                max: 10,
                description: 'Number of items',
              ),
              (_) => child,
            )),
            options: [
              Option(
                label: 'Column',
                value: Column(
                    children: List.generate(
                  context.knobs.sliderInt(
                    label: 'Items count Column',
                    initial: 2,
                    min: 1,
                    max: 10,
                    description: 'Number of items',
                  ),
                  (_) => child,
                )),
              ),
              Option(
                label: 'Row',
                value: Row(
                  children: List.generate(
                    context.knobs.sliderInt(
                      label: 'Items count Row',
                      initial: 1,
                      min: 1,
                      max: 10,
                      description: 'Number of items',
                    ),
                    (_) => child,
                  ),
                ),
              ),
              Option(
                label: 'ListView',
                value: ListView(
                  children: List.generate(
                    context.knobs.sliderInt(
                      label: 'Items count ListView',
                      initial: 1,
                      min: 1,
                      max: 10,
                      description: 'Number of items',
                    ),
                    (_) => child,
                  ),
                ),
              ),
            ],
          ),
        ));
      },
    );
  }```

Navigation in v4 seems broken ?

Hi, thanks a lot for your amazing work on this package :) I tried the migration on v4, but all the navigation seems broken :

`The following assertion was thrown while handling a gesture:
Could not find a generator for route RouteSettings("/stories/my-widget", null) in the _WidgetsAppState.

Make sure your root app widget has provided a way to generate
this route.
Generators for routes are searched for in the following order:

  1. For the "/" route, the "home" property, if non-null, is used.
  2. Otherwise, the "routes" table is used, if it has an entry for the route.
  3. Otherwise, onGenerateRoute is called. It should return a non-null value for any valid route not handled by "home" and "routes".
  4. Finally if all else fails onUnknownRoute is called.
    Unfortunately, onUnknownRoute was not set.`

Did I miss something new ?

Simpler interface on mobile

I have tried several storybook packages and yours does have the best code.
Kudos for a very clean solution.
I was wondering would you consider separate ui for mobile ?
Something like [the interface from other library(https://link.medium.com/QsIhC21zP6) seem to be more user friendly in mobile.
What do you think ?
I’m considering use case of being able to see stories states quickly without too many clicks.
I’d be happy to help with PR

Can you guys add multi themes?

Hi guys, I was testing your lib, congrats, thats great! I'm here to ask if its possible put more than two themes? How can i do it? I was trying wrap the StoryBook with a Provide but the routes crashes rs

thanks

knob to switch locale

It would be great being able to switch locale with a knob or some control in the storybook interface.
Is there a way to do that?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.