feat(proj): init
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
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 dialogsComponent() {
|
||||
return WidgetbookComponent(
|
||||
name: 'AppAlert',
|
||||
useCases: [
|
||||
WidgetbookUseCase(
|
||||
name: 'Alert',
|
||||
builder: (context) {
|
||||
final message = knobText(
|
||||
context,
|
||||
label: 'Message',
|
||||
initialValue: 'Операция будет удалена без возможности восстановления.',
|
||||
);
|
||||
return IosPreview.centered(
|
||||
child: AppAlert(
|
||||
title: knobText(context, label: 'Title', initialValue: 'Удалить трату?'),
|
||||
message: message.isEmpty ? null : message,
|
||||
confirmLabel: knobText(context, label: 'Confirm', initialValue: 'Удалить'),
|
||||
cancelLabel: knobBool(context, label: 'Cancel button', initialValue: true)
|
||||
? 'Отмена'
|
||||
: null,
|
||||
destructive: knobBool(context, label: 'Destructive', initialValue: true),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
WidgetbookUseCase(
|
||||
name: 'Triggers',
|
||||
builder: (context) {
|
||||
return IosPreview(
|
||||
stretch: true,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
AppButton(
|
||||
label: 'Показать alert',
|
||||
onPressed: () => showAppAlert(
|
||||
context: context,
|
||||
title: 'Удалить трату?',
|
||||
message: 'Действие необратимо.',
|
||||
confirmLabel: 'Удалить',
|
||||
cancelLabel: 'Отмена',
|
||||
destructive: true,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: AppSpacing.s3),
|
||||
AppButton(
|
||||
label: 'Показать action sheet',
|
||||
style: AppButtonStyle.gray,
|
||||
onPressed: () => showAppActionSheet(
|
||||
context: context,
|
||||
title: 'Операция',
|
||||
actions: const [
|
||||
AppActionSheetAction(label: 'Редактировать', isDefault: true),
|
||||
AppActionSheetAction(label: 'Дублировать'),
|
||||
AppActionSheetAction(label: 'Удалить', destructive: true),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user