ookami-kb / storybook_flutter

A storybook for Flutter widgets.
https://pub.dev/packages/storybook_flutter
MIT License
288 stars 66 forks source link

feat(plugins): add logging plugin that allows writing logs to storybook #131

Closed buehler closed 7 months ago

buehler commented 8 months ago

This adds a new plugin "logging". This allows getting a log interface from the context to write logs from buttons or actions. One can see the log list with the "quote" icon and can inspect logged messages.

As an example:

Story(
  name: 'Story/Logging',
  builder: (context) => Center(
    child: ElevatedButton(
      onPressed: () => context.logger.log('This is a test message'),
      child: const Text('Log something'),
    ),
  ),
),
buehler commented 8 months ago

Hey @ookami-kb wdyt? :-)

ookami-kb commented 8 months ago

Yeah, LGTM. Please just update golden images (use the ones from the action run artifacts – the ones with _testImage name).

buehler commented 7 months ago

Alright, sorry @ookami-kb for the delay. I updated the golden images and pushed them.

Let me know if you need something :-)

buehler commented 7 months ago

Weird, why do they fail now?

ookami-kb commented 7 months ago

@buehler you can download generated images from the artifacts here: https://github.com/ookami-kb/storybook_flutter/actions/runs/8233183433?pr=131

In general, there are some minor incosistencies between different platforms, so it's better to just copy and commit the generated images from the artifacts, if they look correct.

buehler commented 7 months ago

@ookami-kb Wohow! :-) Thank you for the help regarding the golden images.