mirror of
				https://github.com/flame-engine/flame.git
				synced 2025-10-31 17:06:50 +08:00 
			
		
		
		
	 380781e126
			
		
	
	380781e126
	
	
	
		
			
			* Add * Adding SpriteWidgetBuilder * Adding SpriteButtonBuilder * Add NineTileBoxBuilder * a few adjustments on the docs * Adding error and loading builders to the widgets * Improving APIs for the widget review Co-authored-by: Luan Nico <luanpotter27@gmail.com>
		
			
				
	
	
		
			45 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Dart
		
	
	
	
	
	
			
		
		
	
	
			45 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Dart
		
	
	
	
	
	
| import 'package:dashbook/dashbook.dart';
 | |
| 
 | |
| import '../../commons/commons.dart';
 | |
| import 'nine_tile_box.dart';
 | |
| import 'overlay.dart';
 | |
| import 'sprite_animation_widget.dart';
 | |
| import 'sprite_button.dart';
 | |
| import 'sprite_widget.dart';
 | |
| import 'sprite_widget_section.dart';
 | |
| 
 | |
| void addWidgetsStories(Dashbook dashbook) {
 | |
|   dashbook.storiesOf('Widgets')
 | |
|     ..decorator(CenterDecorator())
 | |
|     ..add(
 | |
|       'Nine Tile Box',
 | |
|       nineTileBoxBuilder,
 | |
|       codeLink: baseLink('widgets/nine_tile_box.dart'),
 | |
|     )
 | |
|     ..add(
 | |
|       'Sprite Button',
 | |
|       spriteButtonBuilder,
 | |
|       codeLink: baseLink('widgets/sprite_button.dart'),
 | |
|     )
 | |
|     ..add(
 | |
|       'Sprite Widget (full image)',
 | |
|       spriteWidgetBuilder,
 | |
|       codeLink: baseLink('widgets/sprite_widget.dart'),
 | |
|     )
 | |
|     ..add(
 | |
|       'Sprite Widget (section of image)',
 | |
|       spriteSectionWidgetBuilder,
 | |
|       codeLink: baseLink('widgets/sprite_widget_section.dart'),
 | |
|     )
 | |
|     ..add(
 | |
|       'Sprite Animation Widget',
 | |
|       spriteAnimationWidgetBuilder,
 | |
|       codeLink: baseLink('widgets/sprite_animation_widget.dart'),
 | |
|     )
 | |
|     ..add(
 | |
|       'Overlay',
 | |
|       overlayBuilder,
 | |
|       codeLink: baseLink('widgets/overlay.dart'),
 | |
|     );
 | |
| }
 |