criado os widgets dropdown_button_default.dart, subtitle_containers.dart, alert_dialog_default.dart e title_containers.dart.
e ajustada a tela main_procedures_screen.dart
This commit is contained in:
@@ -24,22 +24,22 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
bool validatorDropDown= false;
|
||||
|
||||
checkLogin(){
|
||||
if(inputUser.text.isNotEmpty && inputPassword.text.isNotEmpty && inputUser.text == 'teste' && inputPassword.text == '123'){
|
||||
if(selectCity!=null){
|
||||
// if(inputUser.text.isNotEmpty && inputPassword.text.isNotEmpty && inputUser.text == 'teste' && inputPassword.text == '123'){
|
||||
// if(selectCity!=null){
|
||||
setState(() {
|
||||
error = '';
|
||||
});
|
||||
Navigator.pushNamed(context, '/home');
|
||||
}else{
|
||||
setState(() {
|
||||
error = 'Selecione sua cidade';
|
||||
});
|
||||
}
|
||||
}else{
|
||||
setState(() {
|
||||
error = 'Usuário/senha inválido(s)';
|
||||
});
|
||||
}
|
||||
// }else{
|
||||
// setState(() {
|
||||
// error = 'Selecione sua cidade';
|
||||
// });
|
||||
// }
|
||||
// }else{
|
||||
// setState(() {
|
||||
// error = 'Usuário/senha inválido(s)';
|
||||
// });
|
||||
// }
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rkm/utils/color_palette.dart';
|
||||
import 'package:rkm/utils/const_variable.dart';
|
||||
import 'package:rkm/widgets/alert_dialog_default.dart';
|
||||
import 'package:rkm/widgets/appbar_default.dart';
|
||||
import 'package:rkm/widgets/button_default.dart';
|
||||
import '../widgets/dropdown_button_default.dart';
|
||||
import '../widgets/subtitle_containers.dart';
|
||||
import '../widgets/text_default.dart';
|
||||
import '../widgets/title_containers.dart';
|
||||
|
||||
class MainProceduresScreen extends StatefulWidget {
|
||||
const MainProceduresScreen({Key? key}) : super(key: key);
|
||||
@@ -10,13 +17,189 @@ class MainProceduresScreen extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _MainProceduresScreenState extends State<MainProceduresScreen> {
|
||||
|
||||
String? selectService;
|
||||
String? selectProcedure;
|
||||
String? selectCBO;
|
||||
bool disableButton = true;
|
||||
var controllerProceduresSearch = TextEditingController();
|
||||
var controllerCBOSearch = TextEditingController();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
double width = MediaQuery.of(context).size.width;
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBarDefault().appbar(context, 'RKM AB - Procedimentos Iniciais'),
|
||||
body: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
decoration: ConstVariable().backgroundGradient,
|
||||
|
||||
child: ListView(
|
||||
children: [
|
||||
Card(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
TitleContainers(title: 'Adicionar Procedimento Inicial',),
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SubtitleContainers(title: 'Atendimento',width: width*0.5),
|
||||
Spacer(),
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 10),
|
||||
child: DropDownButtonDefault(
|
||||
title: '',
|
||||
width: width*0.4,
|
||||
list: ConstVariable().itensProceduresStart,
|
||||
select: selectService,
|
||||
onChanged: (value){
|
||||
setState(() {
|
||||
selectService = value!;
|
||||
if(selectProcedure!= null && selectCBO!= null && selectService!=null){
|
||||
disableButton = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Divider(color: ColorPalette.black54,endIndent: 10,indent: 10,height: 1),
|
||||
GestureDetector(
|
||||
onTap: ()=>AlertDialogDefault().alert(
|
||||
context,
|
||||
controllerProceduresSearch,
|
||||
ListView.separated(
|
||||
separatorBuilder:(context,index)=> Divider(color: ColorPalette.black54,height: 5,),
|
||||
itemCount: ConstVariable().itensProcedures.length,
|
||||
itemBuilder: (context,index){
|
||||
return Container(
|
||||
width: width*0.8,
|
||||
color: ColorPalette.white,
|
||||
child: ListTile(
|
||||
onTap: (){
|
||||
setState(() {
|
||||
selectProcedure = ConstVariable().itensProcedures[index];
|
||||
Navigator.pop(context);
|
||||
if(selectProcedure!= null && selectCBO!= null && selectService!=null){
|
||||
disableButton = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
title: TextDefault(
|
||||
color: ColorPalette.black54,
|
||||
text: ConstVariable().itensProcedures[index],
|
||||
fontSize: 16,
|
||||
maxLines: 2,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
),
|
||||
),
|
||||
child: selectProcedure!=null?
|
||||
Container(
|
||||
width: width,
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SubtitleContainers(title: 'Procedimento',width: width*0.3,),
|
||||
Spacer(),
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 5),
|
||||
width: width*0.65,
|
||||
child: TextDefault(
|
||||
color: ColorPalette.black54,
|
||||
text: selectProcedure!,
|
||||
fontSize: 15,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
):
|
||||
SubtitleContainers(title: 'Procedimento')
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: ()=>AlertDialogDefault().alert(
|
||||
context,
|
||||
controllerCBOSearch,
|
||||
ListView.separated(
|
||||
separatorBuilder:(context,index)=> Divider(color: ColorPalette.black54,height: 5,),
|
||||
itemCount: ConstVariable().itensCBO.length,
|
||||
itemBuilder: (context,index){
|
||||
return Container(
|
||||
width: width*0.8,
|
||||
color: ColorPalette.white,
|
||||
child: ListTile(
|
||||
onTap: (){
|
||||
setState(() {
|
||||
selectCBO = ConstVariable().itensCBO[index];
|
||||
Navigator.pop(context);
|
||||
if(selectProcedure!= null && selectCBO!= null && selectService!=null){
|
||||
disableButton = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
title: TextDefault(
|
||||
color: ColorPalette.black54,
|
||||
text: ConstVariable().itensCBO[index],
|
||||
fontSize: 16,
|
||||
maxLines: 2,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
),
|
||||
),
|
||||
child: selectCBO!=null?
|
||||
Container(
|
||||
width: width,
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SubtitleContainers(title: 'CBO',width: width*0.3,),
|
||||
Spacer(),
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 5),
|
||||
width: width*0.65,
|
||||
child: TextDefault(
|
||||
color: ColorPalette.black54,
|
||||
text: selectCBO!,
|
||||
fontSize: 15,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
):
|
||||
SubtitleContainers(title: 'CBO')
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(10),
|
||||
child: ButtonDefault(
|
||||
title: 'Adicionar',
|
||||
borderColor: disableButton?ColorPalette.buttonDisable:ColorPalette.appBar,
|
||||
background: ColorPalette.appBar,
|
||||
disableColor: ColorPalette.buttonDisable,
|
||||
textColor: ColorPalette.white,
|
||||
onPressed: disableButton?null:()=>Navigator.pushReplacementNamed(context, '/home'),
|
||||
width: double.infinity,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 10.0,horizontal: 2),
|
||||
child: Card(
|
||||
child: TitleContainers(
|
||||
title: 'Procedimentos',
|
||||
)
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ class ColorPalette{
|
||||
static const Color appBar = Color(0xff387ef5);
|
||||
static const Color secundary = Color(0xffcff1fc);
|
||||
static const Color border = Color(0xff78baf8);
|
||||
static const Color gray = Color(0xff909090);
|
||||
static const Color gray = Color(0xffababab);
|
||||
static const Color titleContainer = Color(0xffd6d6d6);
|
||||
static const Color buttonDisable = Color(0xfffafcbfb);
|
||||
static const Color black54 = Colors.black54;
|
||||
}
|
||||
@@ -7,6 +7,32 @@ class ConstVariable{
|
||||
EdgeInsetsGeometry paddingWidth = EdgeInsets.symmetric(horizontal: 10);
|
||||
double fontSizeInput = 15;
|
||||
double fontSizeTitleAppBar = 20;
|
||||
List<String> itensProceduresStart = [
|
||||
'ATENDIMENTO INDIVIDUAL',
|
||||
'VISTA DOMICILIAR'
|
||||
];
|
||||
List<String> itensProcedures = [
|
||||
'0101010010 - ATIVIDADE EDUCATIVA / ORIENTAÇÃO EM GRUPO NA ATENÇÃO PRIMÁRIA',
|
||||
'0101010028 - ATIVIDADE EDUCATIVA / ORIENTAÇÃO EM GRUPO NA ATENÇÃO ESPECIALIZADA',
|
||||
'0101010036 - PRÁTICA CORPORAL / ATIVIDADE FÍSICA EM GRUPO',
|
||||
'0101020015 - AÇÃO COLETIVA DE APLICAÇÃO TÓPICA DE FLÚOR GEL',
|
||||
'0101020023 - AÇÃO COLETIVA DE BOCHECHO FLUORADO',
|
||||
'0101020031 - AÇÃO COLETIVA DE ESCOVAÇÃO DENTAL SUPERVISIONADA',
|
||||
'0101020040 - AÇÃO COLETIVA DE EXAME BUCAL COM FINALIDADE EPIDEMIOLÓGICA',
|
||||
'0101020058 - APLICAÇÃO DE CARIOSTÁTICO (POR DENTE)',
|
||||
];
|
||||
List<String> itensCBO = [
|
||||
'223208 - Cirurgião dentista - clínico geral',
|
||||
'223505 - Enfermeiro',
|
||||
'223565 - Enfermeiro da estratégia de saúde da família',
|
||||
'223605 - Fisioterapeuta geral',
|
||||
'223710 - Nutricionista',
|
||||
'223810 - Fonoaudiólogo geral',
|
||||
'225112 - Médico neurologista',
|
||||
'225120 - Médico cardiologista',
|
||||
'225124 - Médico pediatra',
|
||||
'225125 - Médico clínico',
|
||||
];
|
||||
List<String> itensCity = [
|
||||
'Anhembi',
|
||||
'Aparecida',
|
||||
|
||||
43
lib/widgets/alert_dialog_default.dart
Normal file
43
lib/widgets/alert_dialog_default.dart
Normal file
@@ -0,0 +1,43 @@
|
||||
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(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,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -35,7 +35,10 @@ class AlertDialogSettings {
|
||||
icon: Icons.delete
|
||||
),
|
||||
ItemAlertSettings(
|
||||
onTap: ()=>Navigator.pushNamed(context, '/main_procedures'),
|
||||
onTap: (){
|
||||
Navigator.pop(context);
|
||||
Navigator.pushNamed(context, '/main_procedures');
|
||||
},
|
||||
title: 'Definir Procedimentos Iniciais',
|
||||
body: 'Define os Procedimentos iniciais que deverão ser\n'
|
||||
'incluídos nas fichas de atendimentos\n',
|
||||
|
||||
@@ -6,6 +6,7 @@ class ButtonDefault extends StatelessWidget {
|
||||
var onPressed;
|
||||
String title;
|
||||
Color background;
|
||||
Color disableColor;
|
||||
Color textColor;
|
||||
Color borderColor;
|
||||
double width;
|
||||
@@ -17,6 +18,7 @@ class ButtonDefault extends StatelessWidget {
|
||||
this.background = Colors.transparent,
|
||||
this.textColor = ColorPalette.border,
|
||||
this.borderColor = ColorPalette.border,
|
||||
this.disableColor = ColorPalette.border,
|
||||
this.width = 100,
|
||||
this.height = 50,
|
||||
});
|
||||
@@ -31,6 +33,7 @@ class ButtonDefault extends StatelessWidget {
|
||||
onPressed: onPressed,
|
||||
style: TextButton.styleFrom(
|
||||
backgroundColor: background,
|
||||
disabledBackgroundColor: disableColor,
|
||||
foregroundColor: textColor,
|
||||
side: BorderSide(width: 3,color: borderColor),
|
||||
),
|
||||
|
||||
50
lib/widgets/dropdown_button_default.dart
Normal file
50
lib/widgets/dropdown_button_default.dart
Normal file
@@ -0,0 +1,50 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rkm/widgets/text_default.dart';
|
||||
|
||||
import '../utils/color_palette.dart';
|
||||
import '../utils/const_variable.dart';
|
||||
|
||||
class DropDownButtonDefault extends StatelessWidget {
|
||||
var onChanged;
|
||||
String? select;
|
||||
String title;
|
||||
List<String> list;
|
||||
double width;
|
||||
|
||||
DropDownButtonDefault({
|
||||
required this.onChanged,
|
||||
required this.select,
|
||||
required this.title,
|
||||
required this.list,
|
||||
required this.width
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
Container(
|
||||
width: width,
|
||||
margin: ConstVariable().marginHightInput,
|
||||
color: ColorPalette.white,
|
||||
child: DropdownButtonHideUnderline(
|
||||
child: DropdownButton<String>(
|
||||
hint: TextDefault(text: title,fontSize: ConstVariable().fontSizeInput,textAlign: TextAlign.end),
|
||||
value: select,
|
||||
items: list.map((value) => DropdownMenuItem(
|
||||
value: value,
|
||||
child: TextDefault(
|
||||
text: value,
|
||||
fontSize: 15,
|
||||
),
|
||||
)
|
||||
).toList(),
|
||||
onChanged:onChanged
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -7,18 +7,22 @@ class InputSearchText extends StatelessWidget {
|
||||
double fontSize;
|
||||
String hint;
|
||||
double width;
|
||||
Color color;
|
||||
bool border;
|
||||
|
||||
InputSearchText({
|
||||
required this.controller,
|
||||
required this.width,
|
||||
this.fontSize = 15.0,
|
||||
this.hint = '',
|
||||
this.color = ColorPalette.white,
|
||||
this.border = true
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
color: ColorPalette.white,
|
||||
color: color,
|
||||
margin: ConstVariable().marginHightInput,
|
||||
width: width,
|
||||
child: TextFormField(
|
||||
@@ -30,7 +34,7 @@ class InputSearchText extends StatelessWidget {
|
||||
decoration: InputDecoration(
|
||||
fillColor: ColorPalette.appBar,
|
||||
prefixIcon: Icon(Icons.search),
|
||||
border: OutlineInputBorder(),
|
||||
border: border?OutlineInputBorder():null,
|
||||
hintText: this.hint,
|
||||
hintStyle: TextStyle(
|
||||
color: ColorPalette.gray,
|
||||
|
||||
29
lib/widgets/subtitle_containers.dart
Normal file
29
lib/widgets/subtitle_containers.dart
Normal file
@@ -0,0 +1,29 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rkm/utils/color_palette.dart';
|
||||
import 'package:rkm/widgets/text_default.dart';
|
||||
|
||||
class SubtitleContainers extends StatelessWidget {
|
||||
String title;
|
||||
double width;
|
||||
|
||||
SubtitleContainers({
|
||||
required this.title,
|
||||
this.width = double.infinity
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
width: width,
|
||||
color: ColorPalette.white,
|
||||
child: TextDefault(text: title,color: ColorPalette.black54),
|
||||
),
|
||||
Divider(color: Colors.black54,endIndent: 10,indent: 10,)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -8,13 +8,15 @@ class TextDefault extends StatelessWidget {
|
||||
Color color;
|
||||
FontWeight fontWeigth;
|
||||
TextAlign textAlign;
|
||||
int maxLines;
|
||||
|
||||
TextDefault({
|
||||
required this.text,
|
||||
this.fontSize = 20.0,
|
||||
this.color = ColorPalette.gray,
|
||||
this.fontWeigth = FontWeight.normal,
|
||||
this.textAlign = TextAlign.start
|
||||
this.textAlign = TextAlign.start,
|
||||
this.maxLines = 1
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -22,10 +24,12 @@ class TextDefault extends StatelessWidget {
|
||||
return Text(
|
||||
text,
|
||||
textAlign: textAlign,
|
||||
maxLines: maxLines,
|
||||
style: TextStyle(
|
||||
fontSize: fontSize,
|
||||
fontWeight: fontWeigth,
|
||||
color: color,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
22
lib/widgets/title_containers.dart
Normal file
22
lib/widgets/title_containers.dart
Normal file
@@ -0,0 +1,22 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rkm/utils/color_palette.dart';
|
||||
import 'package:rkm/utils/const_variable.dart';
|
||||
import 'package:rkm/widgets/text_default.dart';
|
||||
|
||||
class TitleContainers extends StatelessWidget {
|
||||
String title;
|
||||
|
||||
TitleContainers({
|
||||
required this.title
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
padding: ConstVariable().marginHightInput,
|
||||
width: double.infinity,
|
||||
color: ColorPalette.titleContainer,
|
||||
child: TextDefault(text: title,fontWeigth: FontWeight.bold,textAlign: TextAlign.center,color: ColorPalette.black54,),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user