import 'package:flutter/material.dart'; import 'package:test_sa/extensions/int_extensions.dart'; import 'package:test_sa/extensions/text_extensions.dart'; import 'package:test_sa/extensions/widget_extensions.dart'; import 'package:test_sa/new_views/app_style/app_color.dart'; import 'package:test_sa/new_views/common_widgets/app_filled_button.dart'; import 'package:test_sa/views/widgets/item_views/info_header_widget.dart'; import 'package:test_sa/views/widgets/item_views/info_text_widget.dart'; class ConfirmDialog extends StatelessWidget { final String? title; final String? message; final String? okTitle; final VoidCallback? onTap; final VoidCallback? onCloseTap; const ConfirmDialog({Key? key, this.title, this.message, this.okTitle, this.onTap, this.onCloseTap}) : super(key: key); @override Widget build(BuildContext context) { return Dialog( backgroundColor: AppColor.background(context), shape: const RoundedRectangleBorder(), insetPadding: const EdgeInsets.only(left: 21, right: 21), child: Padding( padding: const EdgeInsets.only(left: 20, right: 20, top: 18, bottom: 28), child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ Expanded( child: // InfoHeader16Widget(title ?? "Confirm") InfoTextLabelWidget( label: title ?? "Confirm", textStyle: AppTextStyles.heading5, ) // Text( // title ?? "Confirm", // style: TextStyle(fontSize: 24, fontWeight: FontWeight.w600, color: AppColor.headingTextColor(context), height: 35 / 24, letterSpacing: -0.96), // ) .paddingOnly(top: 0), ), IconButton( padding: EdgeInsets.zero, icon: const Icon(Icons.close), color: AppColor.icon2Color(context), // constraints: const BoxConstraints(), onPressed: () => onCloseTap ?? Navigator.pop(context), // onPressed: () => Navigator.pop(context), ) ], ), message != null ? InfoTextLabelWidget(label: message!, textStyle: AppTextStyles.bodyText) : const SizedBox(), 28.height, AppFilledButton( label: okTitle ?? "OK", onPressed: onTap ?? () => Navigator.pop(context), // textColor: Colors.white, //color: Ap.green, ), ], ), ), ); } }