#sprint-1

This commit is contained in:
User3 2025-05-26 13:55:14 +03:00
parent 8a73c9ffea
commit 7236ed8742
7 changed files with 94 additions and 0 deletions

View File

@ -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<BottomSheetSection> createState() => _BottomSheetSectionState();
}
class _BottomSheetSectionState extends State<BottomSheetSection> {
@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',
),
],
),
);
}
}

View File

@ -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(),
],
),
),

View File

@ -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:

View File

@ -9,6 +9,7 @@ environment:
dependencies:
flutter:
sdk: flutter
modal_bottom_sheet: ^3.0.0
ui_kit:
path: ..

17
lib/bottom_sheet.dart Normal file
View File

@ -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,
),
);
};

View File

@ -8,3 +8,4 @@ export 'input.dart';
export "search.dart";
export 'button.dart';
export 'tabbar.dart';
export 'bottom_sheet.dart';

View File

@ -11,6 +11,7 @@ dependencies:
flutter:
sdk: flutter
flutter_svg: ^2.1.0
modal_bottom_sheet: ^3.0.0
dev_dependencies:
flutter_test: