showcase 0.6.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 59


Pub Package CircleCI

Generate documentation screenshots of your widgets.

Installation #

Add the following to your pubspec.yaml file:

  showcase: <1.0.0

then run:

flutter packages get

Then you can either annotate the widgets you want to have showcased or manually create a test file with multiple widgets:

With annotations #

Add another dependency to your pubspec.yaml file:

  build_runner: ^1.2.8

Just annotate the widgets you want with @Showcased:

import 'package:showcase/showcase.dart';

class MyWidget extends StatelessWidget {
  // ...

The builder will generate a .showcased_test.dart test file for each annotated class file. Just run:

flutter packages pub run build_runner build

Manually testing #

Create a test file with the following:

import 'package:flutter_test/flutter_test.dart';
import 'package:showcase/showcase.dart';

void main() {
  group('Showcase!', () {

Replace the empty list with a collection of widgets. showcaseWidgets also have some options you can tweak.

Then it's just a matter of running flutter test and have your screenshots generated on ./showcase/ (or another output directory you had configured).

Example showcase #

The example app provided generates the following showcase image:


0.6.0 #

  • Make @Showcased annotation receive optional wrapping container size.

0.5.1 #

  • Consider named parameters when querying for required.

0.5.0 #

  • Use forDesignTime when default constructor has required parameters.

In order to be showcased, the @showcased widget class must have a default constructor with no required parameters without default values OR define a forDesignTime() factory constructor. The reason for this is that widgets are usually created with context specific constructor parameters. When rendering the preview of the widget, we don’t necessarily know the right values for these parameters. So, we let the user to provide them for us via this specially named constructor.

0.4.1 #

  • Remove unused import.

0.4.0 #

  • Load custom fonts (defined in project pubspec.yaml) aside from Roboto before showcasing.

0.3.0 #

  • Make showcased widgets display fonts.

Following, it's now possible to display fonts on golden files, so it is on showcase as well.

Showcase will use the Roboto font by trying to locate it on the filesystem package cache folder, or downloading it from the internet.

0.2.0 #

0.1.0 #

  • Beta. Use with caution, lots of missing features.


showcase_example #

This example demonstrates how to use showcase in your projects.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  showcase: ^0.6.0

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:showcase/showcase.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Jul 3, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.13
  • Flutter: 1.17.5

Analysis suggestions

Package not compatible with SDK dart

because of import path [showcase] that is in a package requiring null.

Package not compatible with runtime flutter-web on web

Because of the import of dart:io via the import chain package:showcase/showcase.dartpackage:showcase/fetch_font.dartpackage:glob/glob.dartpackage:glob/src/list_tree.dartpackage:glob/src/io.dartpackage:glob/src/io_export.dartdart:io

Maintenance issues and suggestions

Support latest dependencies. (-10 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency (analyzer).

Package is getting outdated. (-26.30 points)

The package was last published 65 weeks ago.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
analyzer ^0.35.0 0.35.4 0.39.11
build ^1.1.2 1.3.0
dart_style ^1.2.4 1.2.4 1.3.6
flutter 0.0.0
flutter_test 0.0.0
glob ^1.1.7 1.2.0
http ^0.12.0+1 0.12.1
source_gen ^0.9.4+1 0.9.4+4 0.9.5
yaml ^2.1.15 2.2.1
Transitive dependencies
archive 2.0.13
args 1.6.0
async 2.4.1
boolean_selector 2.0.0
charcode 1.1.3
collection 1.14.12 1.14.13
convert 2.1.1
crypto 2.1.4 2.1.5
front_end 0.1.14 0.1.29
http_parser 3.1.4
image 2.1.12 2.1.13
js 0.6.2
kernel 0.3.14 0.3.29
logging 0.11.4
matcher 0.12.6 0.12.8
meta 1.1.8
node_interop 1.1.1
node_io 1.1.1
package_config 1.9.3
path 1.6.4 1.7.0
pedantic 1.9.0 1.9.1
petitparser 2.4.0 3.0.4
pub_semver 1.4.4
quiver 2.1.3
sky_engine 0.0.99
source_span 1.7.0
stack_trace 1.9.3 1.9.5
stream_channel 2.0.0
string_scanner 1.0.5
term_glyph 1.1.0
test_api 0.2.15 0.2.17
typed_data 1.1.6 1.2.0
vector_math 2.0.8
watcher 0.9.7+15
xml 3.6.1 4.2.0
Dev dependencies
test ^1.0.0