Skip to content
Generate documentation screenshots of your widgets.
Dart
Branch: master
Clone or download
Latest commit bf1f23f Apr 15, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
assets/Roboto Make showcased widgets display fonts Mar 24, 2019
example Update examples Apr 14, 2019
lib Check for static forDesignTime returning List<Widget> Apr 14, 2019
.gitignore documentation Oct 7, 2018
.metadata initial commit Sep 29, 2018
CHANGELOG.md 1.0.0, and alpha Apr 15, 2019
LICENSE convert into a lib Oct 7, 2018
README.md Update README build_runner version Mar 26, 2019
analysis_options.yaml convert into a lib Oct 7, 2018
build.yaml more cleaning Oct 7, 2018
pubspec.yaml 1.0.0, and alpha Apr 15, 2019

README.md

Showcase

Pub Package CircleCI

Generate documentation screenshots of your widgets.


Installation

Add the following to your pubspec.yaml file:

dev_dependencies:
  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:

dev_dependencies:
  build_runner: ^1.2.8

Just annotate the widgets you want with @Showcased:

import 'package:showcase/showcase.dart';

@Showcased()
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!', () {
    showcaseWidgets([]);
  });
}

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:

You can’t perform that action at this time.