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'; 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( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, children: [ Container( width: 40, height: 40, margin: EdgeInsets.only(top: 20), decoration: containerRadius(CustomColors.green, 200,), child: Icon(Icons.done,color: Colors.white,), ), mFlex(1), IconButton( icon: Icon( Icons.close, ), onPressed: () { onClick(); Navigator.pop(context); }, ), ], ), mHeight(12), Text( TranslationBase.of(context).RRTRequestSuccess, textAlign: TextAlign.start, style: TextStyle( fontSize: 14, fontWeight: FontWeight.bold, letterSpacing: -0.46, ), ), mHeight(20), Text( TranslationBase.of(context).reqId, 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), ), ], ), ); } }