| 1 | import 'package:flutter/material.dart'; |
| 2 | |
| 3 | class RoundedOverlayCards extends StatelessWidget { |
| 4 | const RoundedOverlayCards({ |
| 5 | this.topCardChild = const SizedBox(), |
| 6 | this.bottomCardChild = const SizedBox(), |
| 7 | }); |
| 8 | |
| 9 | final Widget topCardChild; |
| 10 | final Widget bottomCardChild; |
| 11 | |
| 12 | @override |
| 13 | Widget build(BuildContext context) { |
| 14 | final screenHeight = MediaQuery.of(context).size.height; |
| 15 | |
| 16 | return ClipRRect( |
| 17 | borderRadius: |
| 18 | BorderRadius.only(bottomLeft: Radius.circular(25), bottomRight: Radius.circular(25)), |
| 19 | child: Container( |
| 20 | decoration: BoxDecoration( |
| 21 | borderRadius: const BorderRadius.only( |
| 22 | bottomLeft: Radius.circular(24), |
| 23 | bottomRight: Radius.circular(24), |
| 24 | ), |
| 25 | color: Theme.of(context).colorScheme.surfaceContainer, |
| 26 | ), |
| 27 | child: Column( |
| 28 | mainAxisSize: MainAxisSize.min, |
| 29 | children: [ |
| 30 | Flexible( |
| 31 | child: ClipRRect( |
| 32 | borderRadius: const BorderRadius.only( |
| 33 | bottomLeft: Radius.circular(25), |
| 34 | bottomRight: Radius.circular(25), |
| 35 | ), |
| 36 | child: Container( |
| 37 | decoration: BoxDecoration( |
| 38 | borderRadius: const BorderRadius.only( |
| 39 | bottomLeft: Radius.circular(24), |
| 40 | bottomRight: Radius.circular(24), |
| 41 | ), |
| 42 | color: Theme.of(context).colorScheme.surfaceContainerLow, |
| 43 | ), |
| 44 | constraints: BoxConstraints( |
| 45 | maxHeight: screenHeight * 0.38, |
| 46 | ), |
| 47 | width: double.infinity, |
| 48 | child: topCardChild, |
| 49 | ), |
| 50 | ), |
| 51 | ), |
| 52 | Flexible( |
| 53 | child: bottomCardChild, |
| 54 | ), |
| 55 | ], |
| 56 | ), |
| 57 | ), |
| 58 | ); |
| 59 | } |
| 60 | } |