mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-01 10:38:17 +08:00
linting
This commit is contained in:
@ -12,7 +12,12 @@ void main() async {
|
||||
final nineTileBoxImage = await Flame.images.load('nine_tile_box.png');
|
||||
await Flame.images.load('buttons.png');
|
||||
|
||||
final _buttons = SpriteSheet(imageName: 'buttons.png', textureHeight: 20, textureWidth: 60, columns: 1, rows: 2);
|
||||
final _buttons = SpriteSheet(
|
||||
imageName: 'buttons.png',
|
||||
textureHeight: 20,
|
||||
textureWidth: 60,
|
||||
columns: 1,
|
||||
rows: 2);
|
||||
|
||||
final dashbook = Dashbook();
|
||||
|
||||
@ -38,11 +43,14 @@ void main() async {
|
||||
|
||||
dashbook.storiesOf('SpriteButton').decorator(CenterDecorator()).add(
|
||||
'default',
|
||||
(ctx) => Container(padding: const EdgeInsets.all(20), child: SpriteButton(
|
||||
(ctx) => Container(
|
||||
padding: const EdgeInsets.all(20),
|
||||
child: SpriteButton(
|
||||
onPressed: () {
|
||||
print('Pressed');
|
||||
},
|
||||
label: const Text('Sprite Button', style: const TextStyle(color: const Color(0xFF5D275D))),
|
||||
label: const Text('Sprite Button',
|
||||
style: const TextStyle(color: const Color(0xFF5D275D))),
|
||||
sprite: _buttons.getSprite(0, 0),
|
||||
pressedSprite: _buttons.getSprite(1, 0),
|
||||
)),
|
||||
|
||||
@ -15,7 +15,6 @@ class SpriteButton extends StatefulWidget {
|
||||
@required this.label,
|
||||
@required this.sprite,
|
||||
@required this.pressedSprite,
|
||||
|
||||
this.width,
|
||||
this.height,
|
||||
});
|
||||
@ -49,7 +48,8 @@ class _ButtonState extends State<SpriteButton> {
|
||||
width: width,
|
||||
height: height,
|
||||
child: CustomPaint(
|
||||
painter: _ButtonPainer(_pressed ? widget.pressedSprite : widget.sprite),
|
||||
painter:
|
||||
_ButtonPainer(_pressed ? widget.pressedSprite : widget.sprite),
|
||||
child: Center(
|
||||
child: Container(
|
||||
padding: _pressed ? const EdgeInsets.only(top: 5) : null,
|
||||
|
||||
Reference in New Issue
Block a user