From 46f94d4f881657c19ee9a11d3affa8958994d585 Mon Sep 17 00:00:00 2001 From: PROF25-FINAL Date: Wed, 28 May 2025 10:21:23 +0300 Subject: [PATCH] ProjectCardWidget --- example/lib/storybook.dart | 1 + lib/src/presentation/widgets/card_widget.dart | 66 +++++++++++++++++++ 2 files changed, 67 insertions(+) diff --git a/example/lib/storybook.dart b/example/lib/storybook.dart index 381f1c2..118342e 100644 --- a/example/lib/storybook.dart +++ b/example/lib/storybook.dart @@ -15,6 +15,7 @@ class StorybookApp extends StatelessWidget { BaseCardWidget.story, PrimaryCardWidget.story, CartCardWidget.story, + ProjectCardWidget.story, TabbarWidget.story, InputWidget.story, ChipsButtonWidget.story, diff --git a/lib/src/presentation/widgets/card_widget.dart b/lib/src/presentation/widgets/card_widget.dart index 84a6a8d..1971ec1 100644 --- a/lib/src/presentation/widgets/card_widget.dart +++ b/lib/src/presentation/widgets/card_widget.dart @@ -259,3 +259,69 @@ class CartCardWidget extends BaseCardWidget { }, ); } + +class ProjectCardWidget extends BaseCardWidget { + final String label; + + ProjectCardWidget({super.key, required super.theme, required this.label}) + : super( + width: 335.w, + height: null, + child: Padding( + padding: EdgeInsets.all(16.r), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + spacing: 44.h, + children: [ + Row( + children: [ + Flexible( + child: Text( + label, + style: theme.styles.headlineMedium16.copyWith( + color: theme.palette.blackOld, + ), + ), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Padding( + padding: EdgeInsets.only(bottom: 4.h), + child: Text( + "Прошло 2 дня", + style: theme.styles.captionSemibold14.copyWith( + color: theme.palette.placeholderOld, + ), + ), + ), + SmallButtonWidget.filled( + theme: theme, + onTap: () {}, + text: "Открыть", + ), + ], + ), + ], + ), + ), + ); + + static Story get story => Story( + name: "ProjectCard", + builder: (BuildContext context) { + var theme = CustomTheme.of(context); + String label = context.knobs.text( + label: "Label", + initial: "Мой первый проект", + ); + + return ProjectCardWidget(theme: theme, label: label); + }, + ); +}