-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(widgetbook): 🛠️ uses new
NavigationTree
- Loading branch information
Showing
103 changed files
with
1,364 additions
and
2,547 deletions.
There are no files selected for viewing
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
133 changes: 133 additions & 0 deletions
133
examples/widgetbook_annotation_example/lib/test-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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:meal_app/themes/dark_theme.dart'; | ||
import 'package:meal_app/themes/light_theme.dart'; | ||
import 'package:widgetbook/widgetbook.dart'; | ||
|
||
import 'app.dart'; | ||
|
||
void main() { | ||
runApp(HotReload()); | ||
} | ||
|
||
class HotReload extends StatelessWidget { | ||
const HotReload({Key? key}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Widgetbook.material( | ||
appInfo: AppInfo( | ||
name: 'Test App', | ||
), | ||
addons: [ | ||
CustomThemeAddon<ThemeData>( | ||
setting: ThemeSetting<ThemeData>.firstAsSelected( | ||
themes: [ | ||
WidgetbookTheme( | ||
name: 'Dark', | ||
data: getDarkThemeData(), | ||
), | ||
WidgetbookTheme( | ||
name: 'Light', | ||
data: getLightThemeData(), | ||
), | ||
], | ||
), | ||
), | ||
TextScaleAddon( | ||
setting: TextScaleSetting.firstAsSelected( | ||
textScales: [ | ||
1.0, | ||
2.0, | ||
3.0, | ||
], | ||
), | ||
), | ||
LocalizationAddon( | ||
setting: LocalizationSetting( | ||
locales: locales, | ||
activeLocale: locales.first, | ||
localizationsDelegates: delegates, | ||
), | ||
), | ||
FrameAddon( | ||
setting: FrameSetting.firstAsSelected( | ||
frames: [ | ||
WidgetbookFrame( | ||
setting: DeviceSetting.firstAsSelected( | ||
devices: [Apple.iPhone12], | ||
), | ||
), | ||
NoFrame(), | ||
DefaultDeviceFrame( | ||
setting: DeviceSetting.firstAsSelected( | ||
devices: [Apple.iPhone12], | ||
), | ||
), | ||
], | ||
), | ||
), | ||
], | ||
children: [ | ||
WidgetbookComponent( | ||
name: 'Test Component', | ||
isInitiallyExpanded: true, | ||
useCases: [ | ||
WidgetbookUseCase( | ||
name: 'Test Use Case', | ||
builder: (context) => const TestWidget(), | ||
), | ||
], | ||
), | ||
WidgetbookCategory( | ||
name: 'Test Category', | ||
children: [ | ||
WidgetbookFolder( | ||
name: 'Test Folder', | ||
isInitiallyExpanded: true, | ||
children: [ | ||
WidgetbookComponent( | ||
name: 'Test Component', | ||
isInitiallyExpanded: true, | ||
useCases: [ | ||
WidgetbookUseCase( | ||
name: 'Test Use Case 1', | ||
builder: (context) => | ||
const TestWidget(text: 'Test Widget 1'), | ||
), | ||
], | ||
), | ||
WidgetbookComponent( | ||
name: 'Test Component', | ||
isInitiallyExpanded: true, | ||
useCases: [ | ||
WidgetbookUseCase( | ||
name: 'Test Use Case 2', | ||
builder: (context) => | ||
const TestWidget(text: 'Test Widget 2'), | ||
), | ||
], | ||
), | ||
], | ||
), | ||
], | ||
), | ||
], | ||
); | ||
} | ||
} | ||
|
||
class TestWidget extends StatelessWidget { | ||
const TestWidget({ | ||
super.key, | ||
this.text = 'Test Widget', | ||
}); | ||
|
||
final String text; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
body: Center(child: Text(text)), | ||
); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,2 @@ | ||
class AppInfo { | ||
AppInfo({ | ||
required this.name, | ||
}); | ||
|
||
/// The name of the app or project for which the Widgetbook is created. | ||
/// This name will be displayed in the upper left corner. | ||
final String name; | ||
} | ||
export './models/models.dart'; | ||
export './providers/providers.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class AppInfo { | ||
AppInfo({ | ||
required this.name, | ||
}); | ||
|
||
/// The name of the app or project for which the Widgetbook is created. | ||
/// This name will be displayed in the upper left corner. | ||
final String name; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export './app_info.dart'; |
2 changes: 1 addition & 1 deletion
2
...k/lib/src/app_info/app_info_provider.dart → ...app_info/providers/app_info_provider.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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export './app_info_provider.dart'; |
This file was deleted.
Oops, something went wrong.
50 changes: 0 additions & 50 deletions
50
packages/widgetbook/lib/src/models/organizers/expandable_organizer.dart
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
packages/widgetbook/lib/src/models/organizers/organizer.dart
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.