feat(proj): init
This commit is contained in:
@@ -0,0 +1,80 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:please_pay_me/theme/theme.dart';
|
||||
import 'package:please_pay_me/ui/ui.dart';
|
||||
import 'package:please_pay_me_widgetbook/knobs/common_knobs.dart';
|
||||
import 'package:please_pay_me_widgetbook/support/preview.dart';
|
||||
import 'package:widgetbook/widgetbook.dart';
|
||||
|
||||
WidgetbookComponent buttonsComponent() {
|
||||
return WidgetbookComponent(
|
||||
name: 'AppButton',
|
||||
useCases: [
|
||||
WidgetbookUseCase(
|
||||
name: 'Playground',
|
||||
builder: (context) {
|
||||
return IosPreview(
|
||||
stretch: true,
|
||||
child: AppButton(
|
||||
label: knobText(context, label: 'Label', initialValue: 'Сохранить'),
|
||||
style: knobEnum(
|
||||
context,
|
||||
label: 'Style',
|
||||
values: AppButtonStyle.values,
|
||||
initial: AppButtonStyle.filled,
|
||||
),
|
||||
size: knobEnum(
|
||||
context,
|
||||
label: 'Size',
|
||||
values: AppButtonSize.values,
|
||||
initial: AppButtonSize.large,
|
||||
),
|
||||
expanded: knobBool(context, label: 'Expanded', initialValue: true),
|
||||
loading: knobBool(context, label: 'Loading'),
|
||||
icon: knobBool(context, label: 'Icon') ? CupertinoIcons.plus : null,
|
||||
onPressed:
|
||||
knobBool(context, label: 'Enabled', initialValue: true) ? () {} : null,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
WidgetbookUseCase(
|
||||
name: 'All styles',
|
||||
builder: (context) {
|
||||
return IosPreview(
|
||||
stretch: true,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
for (final style in AppButtonStyle.values) ...[
|
||||
AppButton(label: style.name, style: style, onPressed: () {}),
|
||||
const SizedBox(height: AppSpacing.s3),
|
||||
],
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
WidgetbookUseCase(
|
||||
name: 'Sizes',
|
||||
builder: (context) {
|
||||
return IosPreview.centered(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
for (final size in AppButtonSize.values) ...[
|
||||
AppButton(
|
||||
label: 'Размер ${size.name}',
|
||||
size: size,
|
||||
expanded: false,
|
||||
onPressed: () {},
|
||||
),
|
||||
const SizedBox(height: AppSpacing.s3),
|
||||
],
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user