| 1 | import 'package:cake_wallet/src/widgets/cake_image_widget.dart'; |
| 2 | import 'package:flutter/material.dart'; |
| 3 | |
| 4 | class ModalHeader extends StatelessWidget { |
| 5 | const ModalHeader( |
| 6 | {super.key, |
| 7 | required this.iconPath, |
| 8 | required this.message, |
| 9 | required this.title, |
| 10 | this.bottomWidget}); |
| 11 | |
| 12 | final String iconPath; |
| 13 | final String title; |
| 14 | final String message; |
| 15 | final Widget? bottomWidget; |
| 16 | |
| 17 | @override |
| 18 | Widget build(BuildContext context) { |
| 19 | return Container( |
| 20 | decoration: BoxDecoration( |
| 21 | color: Theme.of(context).colorScheme.surfaceContainer, |
| 22 | borderRadius: BorderRadius.circular(16)), |
| 23 | child: Column( |
| 24 | children: [ |
| 25 | Padding( |
| 26 | padding: const EdgeInsets.all(12.0), |
| 27 | child: Column( |
| 28 | spacing: 10, |
| 29 | mainAxisAlignment: MainAxisAlignment.center, |
| 30 | crossAxisAlignment: CrossAxisAlignment.center, |
| 31 | children: [ |
| 32 | CakeImageWidget(imageUrl: iconPath, width: 36, height: 36), |
| 33 | Text( |
| 34 | title, |
| 35 | style: TextStyle( |
| 36 | fontSize: 16, |
| 37 | fontWeight: FontWeight.w500, |
| 38 | color: Theme.of(context).colorScheme.onSurface), |
| 39 | ), |
| 40 | Padding( |
| 41 | padding: EdgeInsets.symmetric(horizontal: 32), |
| 42 | child: Text( |
| 43 | message, |
| 44 | style: TextStyle( |
| 45 | fontSize: 12, |
| 46 | fontWeight: FontWeight.w400, |
| 47 | color: Theme.of(context).colorScheme.onSurfaceVariant), |
| 48 | textAlign: TextAlign.center, |
| 49 | )), |
| 50 | ], |
| 51 | ), |
| 52 | ), |
| 53 | if (bottomWidget != null) ...[ |
| 54 | Padding( |
| 55 | padding: EdgeInsets.symmetric(horizontal: 18), |
| 56 | child: |
| 57 | Container(height: 1, color: Theme.of(context).colorScheme.surfaceContainerHigh), |
| 58 | ), |
| 59 | ClipRRect( |
| 60 | borderRadius: BorderRadius.vertical(bottom: Radius.circular(16)), |
| 61 | child: bottomWidget!) |
| 62 | ] |
| 63 | ], |
| 64 | ), |
| 65 | ); |
| 66 | } |
| 67 | } |