criado o model service_home_check_condition_model.dart criado o widget check_box_subtitle.dart incrementado o const_variable.dart
141 lines
4.0 KiB
Dart
141 lines
4.0 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,
|
|
)
|
|
],
|
|
);
|
|
}
|
|
);
|
|
}
|
|
|
|
alertSelect(BuildContext context) {
|
|
|
|
List list = [
|
|
'Atendimento Domiciliar',
|
|
'Atendimento Individual',
|
|
'Atendimento Odontológico',
|
|
'Avaliação de Elegibilidade',
|
|
'Ficha Complementar',
|
|
'Marcadores de Consumo',
|
|
'Procedimentos',
|
|
'Visita domiciliar',
|
|
];
|
|
|
|
List routes = [
|
|
'/service_home',
|
|
'/service_individual',
|
|
'/service_dental',
|
|
'/eligibility_assessment',
|
|
'/complementary_sheet',
|
|
'/consumption_markers',
|
|
'/procedures',
|
|
'/home_visit',
|
|
];
|
|
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: 'Seleção de Atendimento',
|
|
color: ColorPalette.black54,
|
|
textAlign: TextAlign.center,
|
|
fontWeigth: FontWeight.bold,
|
|
),
|
|
content: Container(
|
|
width: width*0.8,
|
|
height: height*0.5,
|
|
child: ListView.builder(
|
|
itemCount: list.length,
|
|
itemBuilder: (context,index){
|
|
|
|
int rest = index % 2;
|
|
|
|
return ListTile(
|
|
onTap: ()=>Navigator.pushNamed(context, routes[index]),
|
|
tileColor: rest==0?ColorPalette.white:ColorPalette.appBar,
|
|
title: TextDefault(
|
|
textAlign: TextAlign.center,
|
|
text: list[index],
|
|
color: rest==0?ColorPalette.black54:ColorPalette.white,
|
|
),
|
|
);
|
|
}
|
|
),
|
|
),
|
|
);
|
|
}
|
|
);
|
|
}
|
|
}
|