Last active
February 23, 2021 13:20
-
-
Save isacjunior/440e8621ce01160e85c96e014cbc2532 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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