showcase 0.2.0

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 46

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: ^0.10.0

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:

CHANGELOG

0.2.0

0.1.0

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

Use this package as a library

1. Depend on it

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


dependencies:
  showcase: ^0.2.0

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

Alternatively, your editor might support flutter packages 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';
  
Version Uploaded Documentation Archive
0.2.0 Oct 15, 2018 Go to the documentation of showcase 0.2.0 Download showcase 0.2.0 archive
0.1.0 Oct 7, 2018 Go to the documentation of showcase 0.1.0 Download showcase 0.1.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
46
Learn more about scoring.

We analyzed this package on Dec 5, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.7

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Maintenance suggestions

The description is too short. (-20 points)

Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
build >=0.12.6 <2.0.0 1.0.1
flutter_test 0.0.0
source_gen ^0.9.0 0.9.1+3
Transitive dependencies
analyzer 0.33.6 0.34.0
args 1.5.1
async 2.0.8
boolean_selector 1.0.4
charcode 1.1.2
collection 1.14.11
convert 2.0.2
crypto 2.0.6
csslib 0.14.6
dart_style 1.2.0 1.2.1
flutter 0.0.0
front_end 0.1.6+8 0.1.7
glob 1.1.7
html 0.13.3+3
kernel 0.3.6+8 0.3.7
logging 0.11.3+2
matcher 0.12.3+1 0.12.4
meta 1.1.6
package_config 1.0.5
path 1.6.2
plugin 0.2.0+3
pub_semver 1.4.2
quiver 2.0.1
sky_engine 0.0.99
source_span 1.4.1
stack_trace 1.9.3
stream_channel 1.6.8
string_scanner 1.0.4
term_glyph 1.0.1
test_api 0.2.1
typed_data 1.1.6
utf 0.9.0+5
vector_math 2.0.8
watcher 0.9.7+10
yaml 2.1.15
Dev dependencies
test ^1.0.0