bottom sheet fixes
This commit is contained in:
parent
05f4215faf
commit
6662d4a48f
@ -1,13 +1,15 @@
|
|||||||
|
import 'package:flutter/widgets.dart';
|
||||||
import 'package:refilc/theme/colors/colors.dart';
|
import 'package:refilc/theme/colors/colors.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class RoundedBottomSheet extends StatelessWidget {
|
class RoundedBottomSheet extends StatelessWidget {
|
||||||
const RoundedBottomSheet(
|
const RoundedBottomSheet({
|
||||||
{super.key,
|
super.key,
|
||||||
this.child,
|
this.child,
|
||||||
this.borderRadius = 12.0,
|
this.borderRadius = 16.0,
|
||||||
this.shrink = true,
|
this.shrink = false,
|
||||||
this.showHandle = true});
|
this.showHandle = true,
|
||||||
|
});
|
||||||
|
|
||||||
final Widget? child;
|
final Widget? child;
|
||||||
final double borderRadius;
|
final double borderRadius;
|
||||||
@ -17,6 +19,7 @@ class RoundedBottomSheet extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return AnimatedContainer(
|
return AnimatedContainer(
|
||||||
|
height: 2000,
|
||||||
duration: const Duration(milliseconds: 500),
|
duration: const Duration(milliseconds: 500),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Theme.of(context).colorScheme.background,
|
color: Theme.of(context).colorScheme.background,
|
||||||
@ -25,24 +28,22 @@ class RoundedBottomSheet extends StatelessWidget {
|
|||||||
topRight: Radius.circular(borderRadius),
|
topRight: Radius.circular(borderRadius),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: SafeArea(
|
child: Column(
|
||||||
child: Column(
|
mainAxisSize: shrink ? MainAxisSize.min : MainAxisSize.max,
|
||||||
mainAxisSize: shrink ? MainAxisSize.min : MainAxisSize.max,
|
children: [
|
||||||
children: [
|
if (showHandle)
|
||||||
if (showHandle)
|
Container(
|
||||||
Container(
|
width: 42.0,
|
||||||
width: 42.0,
|
height: 4.0,
|
||||||
height: 4.0,
|
margin: const EdgeInsets.only(top: 12.0, bottom: 4.0),
|
||||||
margin: const EdgeInsets.only(top: 12.0, bottom: 4.0),
|
decoration: BoxDecoration(
|
||||||
decoration: BoxDecoration(
|
borderRadius: BorderRadius.circular(45.0),
|
||||||
borderRadius: BorderRadius.circular(45.0),
|
color: AppColors.of(context).text.withOpacity(0.10),
|
||||||
color: AppColors.of(context).text.withOpacity(0.10),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
if (child != null) child!,
|
),
|
||||||
SizedBox(height: MediaQuery.of(context).padding.bottom),
|
if (child != null) child!,
|
||||||
],
|
SizedBox(height: MediaQuery.of(context).padding.bottom),
|
||||||
),
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -55,6 +56,7 @@ Future<T?> showRoundedModalBottomSheet<T>(
|
|||||||
bool showHandle = true,
|
bool showHandle = true,
|
||||||
}) async {
|
}) async {
|
||||||
return await showModalBottomSheet<T>(
|
return await showModalBottomSheet<T>(
|
||||||
|
useSafeArea: false,
|
||||||
context: context,
|
context: context,
|
||||||
backgroundColor: const Color(0x00000000),
|
backgroundColor: const Color(0x00000000),
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 9ac6e74dafd496c2e1efc4c7f2e8e5d42aac7854
|
Subproject commit fc6bdf78f192234d3dccd899fd82cab45db3762e
|
Loading…
x
Reference in New Issue
Block a user