79 lines
2.3 KiB
Dart
79 lines
2.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:rkm/utils/color_palette.dart';
|
|
import 'package:rkm/utils/const_variable.dart';
|
|
import 'package:rkm/widgets/button_default.dart';
|
|
import 'package:rkm/widgets/item_alert_settings.dart';
|
|
import 'package:rkm/widgets/text_default.dart';
|
|
|
|
import 'dropdown_button_default.dart';
|
|
import 'input_search_text.dart';
|
|
class AlertDialogDefault {
|
|
|
|
@override
|
|
alert_with_search(BuildContext context,controller,Widget list,) {
|
|
|
|
double width = MediaQuery.of(context).size.width;
|
|
double height = MediaQuery.of(context).size.height;
|
|
|
|
return showDialog(
|
|
context: context,
|
|
builder: (context){
|
|
return AlertDialog(
|
|
title: InputSearchText(
|
|
controller: controller,
|
|
width: width*0.3,
|
|
hint: 'Buscar...',
|
|
color: ColorPalette.titleContainer,
|
|
border: false,
|
|
),
|
|
content: Container(
|
|
padding: EdgeInsets.symmetric(vertical: 10),
|
|
width: width*0.8,
|
|
child: Container(
|
|
width: width*0.8,
|
|
height: height*0.8,
|
|
padding: EdgeInsets.symmetric(horizontal: 10),
|
|
child: list,
|
|
),
|
|
),
|
|
);
|
|
}
|
|
);
|
|
}
|
|
|
|
alert(BuildContext context,String title,String subtitle,String textButtom) {
|
|
|
|
double width = MediaQuery.of(context).size.width;
|
|
double height = MediaQuery.of(context).size.height;
|
|
|
|
return showDialog(
|
|
context: context,
|
|
builder: (context){
|
|
return AlertDialog(
|
|
title: TextDefault(
|
|
text: title,
|
|
color: ColorPalette.black54,
|
|
textAlign: TextAlign.center,
|
|
fontWeigth: FontWeight.bold,
|
|
),
|
|
content: TextDefault(
|
|
text: subtitle,
|
|
color: ColorPalette.black54,
|
|
maxLines: 4,
|
|
),
|
|
actions: [
|
|
ButtonDefault(
|
|
onPressed: ()=>Navigator.pop(context),
|
|
title: textButtom,
|
|
width: width*0.85,
|
|
textColor: ColorPalette.white,
|
|
borderColor: ColorPalette.appBar,
|
|
background: ColorPalette.appBar,
|
|
)
|
|
],
|
|
);
|
|
}
|
|
);
|
|
}
|
|
}
|