finalizada a tela service_individual_screen.dart,

ajustada service_home_screen.dart
This commit is contained in:
Reginaldo
2023-03-28 19:48:23 -03:00
parent 407755e0ac
commit d7adeee9af
11 changed files with 1200 additions and 17 deletions

View File

@@ -3,7 +3,9 @@ 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/switch_with_subtitle.dart';
import 'package:rkm/widgets/text_default.dart';
import 'package:rkm/widgets/title_containers.dart';
import 'dropdown_button_default.dart';
import 'input_search_text.dart';
@@ -137,4 +139,271 @@ class AlertDialogDefault {
}
);
}
outherProfessionals(
BuildContext context,String title,String subtitle,String? selectProfessionals,String? selectCBO,String add
) {
double width = MediaQuery.of(context).size.width;
double height = MediaQuery.of(context).size.height;
bool addProfissionals = false;
return showDialog(
context: context,
builder: (context){
return StatefulBuilder(
builder:(context,setState)=> AlertDialog(
titlePadding: EdgeInsets.all(0),
contentPadding: EdgeInsets.all(0),
title: Container(
padding: EdgeInsets.all(10),
color: ColorPalette.blackButton,
child: TextDefault(
text: title,
color: ColorPalette.white,
textAlign: TextAlign.center,
fontWeigth: FontWeight.bold,
),
),
content: Container(
decoration: ConstVariable().backgroundGradient,
child: Column(
children: [
Card(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
TitleContainers(title: subtitle),
DropDownButtonDefault(
onChanged: (value)=>setState((){
selectProfessionals=value;
addProfissionals = true;
}),
select: selectProfessionals,
title: 'Profissional',
list: [
'ADMINISTRADOR',
'ALEXANDRE NITTA',
'ALINE SUELEM LEITE',
'ARIANE FAVORATO ROSA',
],
width: width
),
DropDownButtonDefault(
onChanged: (value)=>setState(()=>selectCBO=value),
select: selectCBO,
title: 'CBO',
list: [],
width: width
),
ButtonDefault(
onPressed:addProfissionals?()=>setState((){
add = selectProfessionals!;
}):null,
title: 'Adicionar',
width: width*0.85,
textColor: ColorPalette.white,
borderColor:addProfissionals?ColorPalette.appBar:ColorPalette.buttonDisable,
background: ColorPalette.appBar,
disableColor: ColorPalette.buttonDisable,
)
],
),
),
Card(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
TitleContainers(title: 'Profissionais'),
add!=''
?Container(
padding: EdgeInsets.all(10),
child: Row(
children: [
TextDefault(text: add,color: ColorPalette.black54,),
Spacer(),
IconButton(
icon: Icon(Icons.delete),
onPressed: ()=>setState((){
add='';
addProfissionals = false;
}),
)
],
),
)
:Container()
],
),
)
],
),
),
actionsAlignment: MainAxisAlignment.start,
actions: [
ButtonDefault(
onPressed: ()=>Navigator.pop(context),
title: 'Fechar',
width: width*0.2,
textColor: ColorPalette.black54,
borderColor: ColorPalette.white,
background: ColorPalette.white,
)
],
),
);
}
);
}
outherExams(
BuildContext context,
String title,String subtitle,
String? selectProfessionals,
String? selectCBO,
String add,
List examsList,
bool requested,
bool avaliable
) {
double width = MediaQuery.of(context).size.width;
double height = MediaQuery.of(context).size.height;
bool addProfissionals = false;
return showDialog(
context: context,
builder: (context){
return StatefulBuilder(
builder:(context,setState)=> AlertDialog(
titlePadding: EdgeInsets.all(0),
contentPadding: EdgeInsets.all(0),
title: Container(
padding: EdgeInsets.all(10),
color: ColorPalette.blackButton,
child: TextDefault(
text: title,
color: ColorPalette.white,
textAlign: TextAlign.center,
fontWeigth: FontWeight.bold,
),
),
content: Container(
decoration: ConstVariable().backgroundGradient,
child: Column(
children: [
Card(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
TitleContainers(title: subtitle),
DropDownButtonDefault(
onChanged: (value)=>setState((){
selectProfessionals=value;
addProfissionals = true;
}),
select: selectProfessionals,
title: 'Exame',
list: [
'0201010011 - AMNIOCENTESE',
'0201010020 - BIOPSIA / PUNSAO DE TUMOR SUPERFICIAL DA PELE',
'0201010046 - BIOPSIA DE ANUS E CANAL ANAL',
'0201010062 - BIOSIA DE BEXIGA',
],
width: width
),
SwitchWithSubtitle(
onChanged: (v)=>setState(()=>requested=v),
value: requested,
width: width*0.8,
title: 'Solicitado'
),
SwitchWithSubtitle(
onChanged: (v)=>setState(()=>avaliable=v),
value: avaliable,
width: width*0.8,
title: 'Avaliado'
),
ButtonDefault(
onPressed:addProfissionals || examsList.length == 4?()=>setState((){
List list = selectProfessionals!.split(' - ');
add = list[0] + '${requested?' - S':''}' + '${avaliable?' - A':''}'+' - ${list[1]}';
if(examsList.length<=3){
examsList.add(add);
}else{
addProfissionals = false;
}
selectProfessionals=null;
avaliable = false;
requested = false;
}):null,
title: 'Adicionar',
width: width*0.85,
textColor: ColorPalette.white,
borderColor:addProfissionals?ColorPalette.appBar:ColorPalette.buttonDisable,
background: ColorPalette.appBar,
disableColor: ColorPalette.buttonDisable,
)
],
),
),
Card(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
TitleContainers(title: 'Exames'),
examsList.length!=0
?Container(
width: width*0.8,
height: height*0.4,
child: ListView.builder(
itemCount: examsList.length,
itemBuilder: (context,index) {
return Container(
width: width * 0.8,
padding: EdgeInsets.all(10),
child: Row(
children: [
Container(
width: width * 0.6,
child: TextDefault(text: examsList[index],
color: ColorPalette.black54,)
),
Spacer(),
IconButton(
icon: Icon(Icons.delete),
onPressed: () =>
setState(() {
examsList.removeAt(index);
}),
)
],
),
);
}
),
)
:Container()
],
),
)
],
),
),
actionsAlignment: MainAxisAlignment.start,
actions: [
ButtonDefault(
onPressed: ()=>Navigator.pop(context),
title: 'Fechar',
width: width*0.2,
textColor: ColorPalette.black54,
borderColor: ColorPalette.white,
background: ColorPalette.white,
)
],
),
);
}
);
}
}

View File

@@ -8,12 +8,14 @@ class CheckBoxSubtitle extends StatelessWidget {
String subtitle;
bool checkbox;
var onChanged;
double fontSize;
CheckBoxSubtitle({
this.width = double.infinity,
required this.checkbox,
required this.subtitle,
required this.onChanged,
this.fontSize = 15
});
@override
@@ -29,7 +31,7 @@ class CheckBoxSubtitle extends StatelessWidget {
),
Container(
width: width,
child: TextDefault(text: subtitle,fontSize: 15,color: ColorPalette.black54,)
child: TextDefault(text: subtitle,fontSize: fontSize,color: ColorPalette.black54,)
),
],
),

View File

@@ -13,6 +13,7 @@ class InputText extends StatelessWidget {
bool enable;
TextInputType textInputType;
int maxLines;
Color colorBorder;
InputText({
required this.controller,
@@ -25,6 +26,7 @@ class InputText extends StatelessWidget {
this.enable = true,
this.textInputType = TextInputType.text,
this.maxLines = 1,
this.colorBorder = ColorPalette.black54
});
@override
@@ -51,7 +53,21 @@ class InputText extends StatelessWidget {
decoration: InputDecoration(
fillColor: ColorPalette.appBar,
labelText: label,
border: OutlineInputBorder(),
border: OutlineInputBorder(
borderSide: BorderSide(width: 2,color: colorBorder)
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(width: 3, color: colorBorder),
borderRadius: BorderRadius.circular(15),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(width: 3, color: colorBorder),
borderRadius: BorderRadius.circular(15),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(width: 3, color: colorBorder),
borderRadius: BorderRadius.circular(15),
),
hintText: this.hint,
enabled: enable,
hintStyle: TextStyle(

View File

@@ -14,6 +14,7 @@ class InputWithSubtitle extends StatelessWidget {
bool enable;
TextInputType textInputType;
int maxLines;
Color colorBorder;
InputWithSubtitle({
required this.subtitle,
@@ -26,6 +27,7 @@ class InputWithSubtitle extends StatelessWidget {
this.enable = true,
this.textInputType = TextInputType.text,
this.maxLines = 1,
this.colorBorder = ColorPalette.black54
});
@override
@@ -51,7 +53,8 @@ class InputWithSubtitle extends StatelessWidget {
label: labelInput,
enable: enable,
textInputType: textInputType,
maxLines:maxLines
maxLines:maxLines,
colorBorder: colorBorder,
),
Divider(color: ColorPalette.black54,height: 5,endIndent: 10,)
],

View File

@@ -33,7 +33,7 @@ class ItemCitizen extends StatelessWidget {
title: TextDefault(text: name,fontWeigth: FontWeight.bold),
subtitle: TextDefault(text: '$numberCNS - $numberMedicalRecord - $date - $mother',fontSize: 16),
trailing: IconButton(
icon: Icon(Icons.assignment_outlined),
icon: Icon(Icons.assignment_rounded,size: 35,),
onPressed: ()=>AlertDialogDefault().alertSelect(context),
),
onTap: onTap,

View File

@@ -6,19 +6,21 @@ import 'package:rkm/widgets/text_default.dart';
class TitleContainers extends StatelessWidget {
String title;
double width;
TextAlign textAling;
TitleContainers({
required this.title,
this.width = double.infinity
this.width = double.infinity,
this.textAling = TextAlign.center
});
@override
Widget build(BuildContext context) {
return Container(
padding: ConstVariable().marginHightInput,
padding: textAling!=TextAlign.center?EdgeInsets.all(10):ConstVariable().marginHightInput,
width: width,
color: ColorPalette.titleContainer,
child: TextDefault(text: title,fontWeigth: FontWeight.bold,textAlign: TextAlign.center,color: ColorPalette.black54,),
child: TextDefault(text: title,fontWeigth: FontWeight.bold,textAlign: textAling,color: ColorPalette.black54,),
);
}
}