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',
|
||||
)
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user