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
// lib/widgetbook.dart | |
import 'package:flutter/material.dart'; | |
import 'package:flutter_screenutil/flutter_screenutil.dart'; | |
import 'package:widgetbook/widgetbook.dart'; | |
import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; | |
import 'package:widgetbook_core/widgetbook_core.dart'; | |
import 'widgetbook.g.dart'; | |
void main() { |
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
// lib/main.dart | |
import 'package:flutter/material.dart'; | |
import 'package:widgetbook/widgetbook.dart'; | |
void main() { | |
runApp(const WidgetbookApp()); | |
} | |
class WidgetbookApp extends StatelessWidget { | |
const WidgetbookApp({Key? key}) : super(key: key); |
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
flutter run -d chrome -t lib/widgetbook.dart |
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
// 'widgetbook.directories.g.dart' | |
// coverage:ignore-file | |
// ignore_for_file: type=lint | |
// ignore_for_file: unused_import, prefer_relative_imports, directives_ordering | |
// GENERATED CODE - DO NOT MODIFY BY HAND | |
// ************************************************************************** |
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
flutter pub run build_runner build --delete-conflicting-outputs |
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
// lib/components/custom_button.dart | |
import 'package:flutter/material.dart'; | |
import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; | |
class CustomButton extends StatelessWidget { | |
const CustomButton({ | |
super.key, | |
required this.title, | |
this.onPressed, | |
}); |
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
// single app | |
flutter_app | |
└─── lib | |
| └─── feature.dart | |
│ └─── main.dart | |
│ └─── main.widgetbook.dart | |
└─── pubspec.yaml | |
// separate app | |
flutter_app |
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
// widgetbook.dart | |
import 'package:flutter/material.dart'; | |
import 'package:widgetbook/widgetbook.dart'; | |
import 'package:widgetbook_annotation/widgetbook_annotation.dart' as widgetbook; | |
// Import the generated directories variable | |
import 'widgetbook.directories.g.dart'; | |
void main() { |
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: | |
widgetbook_annotation: ^3.0.0 | |
dev_dependencies: | |
widgetbook: ^3.0.0 | |
widgetbook_generator: ^3.0.0 | |
build_runner: |