From 7236ed8742724ebda5ee68dd3f209dc19ce8cd4c Mon Sep 17 00:00:00 2001 From: User3 Date: Mon, 26 May 2025 13:55:14 +0300 Subject: [PATCH] #sprint-1 --- example/lib/bottom_sheet_section.dart | 64 +++++++++++++++++++++++++++ example/lib/main.dart | 2 + example/pubspec.lock | 8 ++++ example/pubspec.yaml | 1 + lib/bottom_sheet.dart | 17 +++++++ lib/ui_kit.dart | 1 + pubspec.yaml | 1 + 7 files changed, 94 insertions(+) create mode 100644 example/lib/bottom_sheet_section.dart create mode 100644 lib/bottom_sheet.dart diff --git a/example/lib/bottom_sheet_section.dart b/example/lib/bottom_sheet_section.dart new file mode 100644 index 0000000..bd8ab06 --- /dev/null +++ b/example/lib/bottom_sheet_section.dart @@ -0,0 +1,64 @@ +import 'package:flutter/material.dart'; +import 'package:ui_kit/ui_kit.dart'; +import 'package:flutter_svg/flutter_svg.dart'; + +class BottomSheetSection extends StatefulWidget { + const BottomSheetSection({super.key}); + + @override + State createState() => _BottomSheetSectionState(); +} + +class _BottomSheetSectionState extends State { + @override + Widget build(BuildContext context) { + return Container( + margin: EdgeInsets.only(top: height(context) * 3), + child: Column( + children: [ + ButtonWidget( + onPressed: () { + showBottomSheetFunc(Column(), context); + }, + label: "Показать Модалку(Background)", + variant: 'flat', + ), + SizedBox(height: height(context) * 3), + ButtonWidget( + onPressed: () { + showBottomSheetFunc( + Column( + children: [ + Container( + padding: EdgeInsets.symmetric( + horizontal: 20, + vertical: 24, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + width: width(context) * 60, + child: Text( + 'Рубашка Воскресенье для машинного вязания', + style: title1ExtraBold, + ), + ), + SvgPicture.asset('assets/close.svg'), + ], + ), + ), + ], + ), + context, + ); + }, + label: 'Показать Модалку', + variant: 'flat', + ), + ], + ), + ); + } +} diff --git a/example/lib/main.dart b/example/lib/main.dart index 4ba0761..c1479a0 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -1,3 +1,4 @@ +import 'package:example/bottom_sheet_section.dart'; import 'package:example/button_section.dart'; import 'package:example/colors_section.dart'; import 'package:example/fonts_section.dart'; @@ -33,6 +34,7 @@ class MainApp extends StatelessWidget { ButtonSection(), SmallButtonSection(), TabBarWidget(), + BottomSheetSection(), ], ), ), diff --git a/example/pubspec.lock b/example/pubspec.lock index e8870d7..0e8196e 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -155,6 +155,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.16.0" + modal_bottom_sheet: + dependency: "direct main" + description: + name: modal_bottom_sheet + sha256: eac66ef8cb0461bf069a38c5eb0fa728cee525a531a8304bd3f7b2185407c67e + url: "https://pub.dev" + source: hosted + version: "3.0.0" path: dependency: transitive description: diff --git a/example/pubspec.yaml b/example/pubspec.yaml index deb77f8..9fe7f4b 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -9,6 +9,7 @@ environment: dependencies: flutter: sdk: flutter + modal_bottom_sheet: ^3.0.0 ui_kit: path: .. diff --git a/lib/bottom_sheet.dart b/lib/bottom_sheet.dart new file mode 100644 index 0000000..bf454c4 --- /dev/null +++ b/lib/bottom_sheet.dart @@ -0,0 +1,17 @@ +// ignore_for_file: prefer_function_declarations_over_variables + +import 'package:flutter/material.dart'; +import 'package:modal_bottom_sheet/modal_bottom_sheet.dart'; +import 'package:ui_kit/ui_kit.dart'; + +final showBottomSheetFunc = (Widget children, context) { + return showCupertinoModalBottomSheet( + context: context, + backgroundColor: whiteColor, + builder: (context) => Container( + color: whiteColor, + width: width(context) * 100, + child: children, + ), + ); +}; diff --git a/lib/ui_kit.dart b/lib/ui_kit.dart index ccf7b9e..fa558d0 100644 --- a/lib/ui_kit.dart +++ b/lib/ui_kit.dart @@ -8,3 +8,4 @@ export 'input.dart'; export "search.dart"; export 'button.dart'; export 'tabbar.dart'; +export 'bottom_sheet.dart'; diff --git a/pubspec.yaml b/pubspec.yaml index 00b4222..8fd53af 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,6 +11,7 @@ dependencies: flutter: sdk: flutter flutter_svg: ^2.1.0 + modal_bottom_sheet: ^3.0.0 dev_dependencies: flutter_test: