Files
rkm_educa_app/lib/componentes/alert_default.dart

40 lines
1.2 KiB
Dart

import 'package:flutter/material.dart';
import 'package:rkm_educa_app/utils/cores.dart';
import 'package:rkm_educa_app/componentes/buttom_custom.dart';
import 'package:rkm_educa_app/componentes/text_custom.dart';
class AlertDefault{
alert(BuildContext context,String title,String textButtom,Widget subtitle,) {
double width = MediaQuery.of(context).size.width;
double height = MediaQuery.of(context).size.height;
return showDialog(
context: context,
builder: (context){
return AlertDialog(
title: TextCustom(
text: title,
color: Colors.black54,
textAlign: TextAlign.center,
fontWeight: FontWeight.bold,
),
content: subtitle,
actions: [
ButtonCustom(
onPressed: ()=>Navigator.pop(context),
text: textButtom,
widthCustom: 0.2,
heightCustom: 0.05,
size: 14,
colorText: Colors.white,
colorBorder: PaletaCores.cinza,
colorButton: PaletaCores.cinza,
)
],
actionsAlignment: MainAxisAlignment.center,
);
}
);
}
}