feat(proj): init
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
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 progressComponent() {
|
||||
return WidgetbookComponent(
|
||||
name: 'Progress',
|
||||
useCases: [
|
||||
WidgetbookUseCase(
|
||||
name: 'Activity indicator',
|
||||
builder: (context) {
|
||||
return IosPreview.centered(
|
||||
child: AppSpinner(
|
||||
radius: knobDouble(context, label: 'Radius', initialValue: 14, min: 6, max: 28),
|
||||
color: knobTint(context),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
WidgetbookUseCase(
|
||||
name: 'Progress bar',
|
||||
builder: (context) {
|
||||
return IosPreview(
|
||||
stretch: true,
|
||||
padding: const EdgeInsets.all(AppSpacing.s4),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
AppProgressBar(
|
||||
value: knobDouble(context, label: 'Value', initialValue: 0.42),
|
||||
color: knobTint(context),
|
||||
height: knobDouble(context, label: 'Height', initialValue: 4, min: 2, max: 12),
|
||||
),
|
||||
const SizedBox(height: AppSpacing.s4),
|
||||
const AppProgressBar(value: 0.15, color: AppColors.systemRed),
|
||||
const SizedBox(height: AppSpacing.s4),
|
||||
const AppProgressBar(value: 1, color: AppColors.systemGreen),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
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 skeletonsComponent() {
|
||||
return WidgetbookComponent(
|
||||
name: 'AppSkeleton',
|
||||
useCases: [
|
||||
WidgetbookUseCase(
|
||||
name: 'Block',
|
||||
builder: (context) {
|
||||
return IosPreview.centered(
|
||||
child: AppSkeleton(
|
||||
width: knobDouble(context, label: 'Width', initialValue: 200, min: 40, max: 320),
|
||||
height: knobDouble(context, label: 'Height', initialValue: 16, min: 8, max: 80),
|
||||
radius: knobDouble(context, label: 'Radius', initialValue: 6, min: 0, max: 24),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
WidgetbookUseCase(
|
||||
name: 'List loading',
|
||||
builder: (context) {
|
||||
final rows = knobInt(context, label: 'Rows', initialValue: 4, min: 1, max: 8);
|
||||
return IosPreview(
|
||||
stretch: true,
|
||||
child: AppListSection(
|
||||
header: 'Загрузка',
|
||||
separatorIndent: 60,
|
||||
children: List.generate(rows, (_) => const AppSkeletonRow()),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
import 'package:flutter/cupertino.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 toastsComponent() {
|
||||
return WidgetbookComponent(
|
||||
name: 'AppToast',
|
||||
useCases: [
|
||||
WidgetbookUseCase(
|
||||
name: 'Static',
|
||||
builder: (context) {
|
||||
return IosPreview.centered(
|
||||
child: AppToast(
|
||||
message: knobText(context, label: 'Message', initialValue: 'Трата сохранена'),
|
||||
tint: knobTint(context),
|
||||
icon: knobBool(context, label: 'Icon', initialValue: true)
|
||||
? CupertinoIcons.check_mark_circled_solid
|
||||
: null,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
WidgetbookUseCase(
|
||||
name: 'Trigger',
|
||||
builder: (context) {
|
||||
return IosPreview(
|
||||
stretch: true,
|
||||
child: AppButton(
|
||||
label: 'Показать toast',
|
||||
onPressed: () => showAppToast(
|
||||
context,
|
||||
message: knobText(
|
||||
context,
|
||||
label: 'Message',
|
||||
initialValue: 'Трата сохранена',
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user