import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:flutter/material.dart'; import 'package:progress_hud_v2/generated/i18n.dart'; Future showCMCConfirmDialog(BuildContext context, String requestId, {Function onClick}) async { return showDialog( context: context, barrierDismissible: false, // user must tap button! builder: (BuildContext context) { return Dialog( child: Column( mainAxisSize: MainAxisSize.min, children: [ ConfirmDialog(requestId,onClick: onClick,), ], ), ); }, ); } class ConfirmDialog extends StatelessWidget { String requestId; Function onClick; ConfirmDialog(this.requestId, {this.onClick}); @override Widget build(BuildContext context) { return Container( width: double.infinity, padding: EdgeInsets.all(20), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( children: [ mFlex(1), IconButton( icon: Icon( Icons.close, ), onPressed: () { onClick(); Navigator.pop(context); }, ), ], ), Text( "Request has been sent successfully. You will be contacted soon.", textAlign: TextAlign.start, style: TextStyle( fontSize: 14, fontWeight: FontWeight.bold, letterSpacing: -0.46, ), ), mHeight(20), Text( "Request ID", style: TextStyle( fontSize: 14, fontWeight: FontWeight.bold, color: Colors.grey[600], letterSpacing: -0.46, ), ), Text( requestId ?? "", style: TextStyle( fontSize: 18, fontWeight: FontWeight.bold, color: Colors.black, letterSpacing: -0.46, ), ), mHeight(20), Container( width: MediaQuery.of(context).size.width * 0.9, child: SecondaryButton( label: TranslationBase.of(context).ok.toUpperCase(), color: CustomColors.accentColor, onTap: () async { onClick(); Navigator.pop(context); }, textColor: Theme.of(context).backgroundColor), ), ], ), ); } }