You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			66 lines
		
	
	
		
			2.4 KiB
		
	
	
	
		
			Dart
		
	
			
		
		
	
	
			66 lines
		
	
	
		
			2.4 KiB
		
	
	
	
		
			Dart
		
	
| import 'package:easy_localization/easy_localization.dart';
 | |
| import 'package:hmg_patient_app_new/extensions/int_extensions.dart';
 | |
| import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
 | |
| import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
 | |
| import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
 | |
| import 'package:hmg_patient_app_new/widgets/default_button.dart';
 | |
| import 'package:flutter/material.dart';
 | |
| 
 | |
| import '../../theme/colors.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, required this.message, this.okTitle, this.onTap, this.onCloseTap}) : super(key: key);
 | |
| 
 | |
|   @override
 | |
|   Widget build(BuildContext context) {
 | |
|     return Dialog(
 | |
|       backgroundColor: Colors.white,
 | |
|       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.start,
 | |
|               children: [
 | |
|                 Expanded(
 | |
|                   child: Text(
 | |
|                     title ?? LocaleKeys.confirm.tr(),
 | |
|                     style: const TextStyle(fontSize: 24, fontWeight: FontWeight.w600, color: blackColor, height: 35 / 24, letterSpacing: -0.96),
 | |
|                   ).paddingOnly(top: 16),
 | |
|                 ),
 | |
|                 IconButton(
 | |
|                   padding: EdgeInsets.zero,
 | |
|                   icon: const Icon(Icons.close),
 | |
|                   color: blackColor,
 | |
|                   constraints: const BoxConstraints(),
 | |
|                   onPressed: () => onCloseTap ?? Navigator.pop(context),
 | |
|                   // onPressed: () => Navigator.pop(context),
 | |
|                 )
 | |
|               ],
 | |
|             ),
 | |
|             14.height,
 | |
|             message.toText16(color: lightGrayColor),
 | |
|             28.height,
 | |
|             DefaultButton(
 | |
|               okTitle ?? LocaleKeys.ok.tr(),
 | |
|               onTap ?? () => Navigator.pop(context),
 | |
|               textColor: Colors.white,
 | |
|               //color: Ap.green,
 | |
|             ),
 | |
|           ],
 | |
|         ),
 | |
|       ),
 | |
|     );
 | |
|   }
 | |
| }
 |