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
class Counter { | |
Counter({this.count}); | |
int count; | |
void increment() { | |
count++; | |
} | |
void decrement() { |
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. |
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
dependencies: | |
flutter: | |
sdk: flutter | |
another_package: | |
path: ../another_package |
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:flutter/material.dart'; | |
import 'package:flutter_test/flutter_test.dart'; | |
import 'package:widget_test/heart.dart'; | |
// Função auxiliar para envolver os widgets a serem testados. | |
Widget makeTestable(Widget widget) => MaterialApp(home: widget); | |
void main() { | |
testWidgets('Heart smoke test', (WidgetTester tester) async { | |
// pumpWidget() renderiza a UI dado um widget. |
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:flutter/widgets.dart'; | |
void main() => runApp(TopWidget()); | |
class CounterInherited extends InheritedWidget { | |
CounterInherited({ | |
Key key, | |
@required this.state, | |
@required Widget child, | |
}) : super(key: key, child: child); |
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:flutter/widgets.dart'; | |
void main() => runApp(TopWidget()); | |
class TopWidget extends StatefulWidget { | |
@override | |
_TopWidgetState createState() => _TopWidgetState(); | |
} | |
class _TopWidgetState extends State<TopWidget> { |
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
// .vscode/settings.json | |
{ | |
"dart.analysisExcludedFolders": [ | |
"lib/generated" | |
] | |
} |
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
# analysis_options.yaml | |
analyzer: | |
exclude: | |
- lib/generated/** |
NewerOlder