Skip to content

Instantly share code, notes, and snippets.

@isacjunior
Last active February 23, 2021 13:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save isacjunior/440e8621ce01160e85c96e014cbc2532 to your computer and use it in GitHub Desktop.
Save isacjunior/440e8621ce01160e85c96e014cbc2532 to your computer and use it in GitHub Desktop.
import 'package:example/src/widgets/button.dart';
import 'package:example/src/widgets/button.doc_widget.dart';
import 'package:flutter/material.dart';
import 'package:doc_widget/doc_widget.dart';
void main() {
final button = ElementPreview(
document: ButtonDocWidget(), // From generated file
previews: [
WidgetPreview( // This will show your widget and a description about.
widget: Button(
'Button',
onPressed: () => print('Hello'),
),
description: 'Default button.',
),
],
);
runApp(DocPreview(elements: [button])); // Application that will show all elements.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment