ajustes de layout

This commit is contained in:
Reginaldo
2023-08-11 17:12:50 -03:00
parent 1ffaa70fed
commit 4500ee04aa
9 changed files with 197 additions and 125 deletions

View File

@@ -39,9 +39,10 @@ class _HomeScreenState extends State<HomeScreen> {
carregarAlunos()async{
resultadoPesquisa.clear();
alunos.clear();
String q = inputPesquisa.text.replaceAll(' ', '%20').toUpperCase();
String aluno = inputPesquisa.text.replaceAll(' ', '%20').toUpperCase();
String escola = widget.dados[3].replaceAll(' ', '%20').toUpperCase();
// print(q);
final url = '${widget.dados[2]}/aluno?NOME=$q&CIDADE=${widget.dados[0]}';
final url = '${widget.dados[2]}/aluno?NOME=$aluno&CIDADE=${widget.dados[0]}&ANO=${DateTime.now().year}&ESCOLA=$escola';
print(url);
final response = await http.get(Uri.parse(url));
var map = json.decode(response.body);
@@ -214,21 +215,36 @@ class _HomeScreenState extends State<HomeScreen> {
child: showEscola?ListView(
children: [
SizedBox(height: height*0.05),
Padding(
padding: EdgeInsets.symmetric(horizontal: width>900?width*0.1:width*0.05),
Container(
margin: EdgeInsets.symmetric(horizontal: width*0.1),
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Container(
height: 35,
width: 70,
alignment: Alignment.center,
child: TextCustom(text: 'BUSCAR',color: Colors.black,size: 12.0),
decoration: BoxDecoration(
borderRadius: BorderRadius.only(topLeft: Radius.circular(3.0),bottomLeft: Radius.circular(3.0),),
color: PaletteColors.greySearch,
border: Border.all(color: PaletteColors.grey)
),
),
InputText(
borderRadius: 0,
hint: 'Pesquisar por login do usuário'.toUpperCase(),
controller: inputPesquisa,
width: width*0.25,
width: width*0.662,
inputFormatters: [],
fontSize: 14,
colorBackground: Colors.white,
),
SizedBox(width: 10,),
ButtonCustom(
borderRadiusbottomLeft: 0,
borderRadiustopLeft: 0,
borderRadiusbottomRight: 0,
borderRadiustopRight: 0,
widthCustom: 0.05,
text: "PESQUISAR",
fontSize: 10.0,
@@ -247,14 +263,15 @@ class _HomeScreenState extends State<HomeScreen> {
}
},
),
SizedBox(width: 10,),
ButtonCustom(
borderRadiusbottomLeft: 0,
borderRadiustopLeft: 0,
widthCustom: 0.05,
text: "LIMPAR",
fontSize: 10.0,
colorText: PaletteColors.white,
colorButton: PaletteColors.primaryColor,
colorBorder: PaletteColors.primaryColor,
colorButton: PaletteColors.grey,
colorBorder: PaletteColors.grey,
onPressed: ()=>setState((){
inputPesquisa.clear();
resultadoPesquisa.clear();
@@ -265,15 +282,19 @@ class _HomeScreenState extends State<HomeScreen> {
)
),
Container(
margin: EdgeInsets.symmetric(vertical: 20),
padding: EdgeInsets.symmetric(horizontal: width>900?width*0.1:width*0.05),
margin: EdgeInsets.only(top: 20,right: width*0.1,left: width*0.1),
width: width,
height: 42,
alignment: Alignment.center,
decoration: BoxDecoration(
color: PaletteColors.greySearch,
border: Border.all(color: PaletteColors.grey)
),
child: Row(
children: [
SizedBox(width: 30,),
Container(
width: width*0.1,
width: width*0.15,
child: TextCustom(text: 'USUÁRIO',size: 12,fontWeight: FontWeight.bold,color: Colors.black87,),
),
Container(
@@ -292,12 +313,16 @@ class _HomeScreenState extends State<HomeScreen> {
),
),
Container(
padding: EdgeInsets.symmetric(horizontal: width>900?width*0.1:width*0.05),
height: height*0.7,
decoration: BoxDecoration(
border: Border.all(color: logins.length==0?Colors.white:PaletteColors.grey)
),
margin: EdgeInsets.symmetric(horizontal: width>900?width*0.1:width*0.05),
height: height*0.77,
child: ListView.builder(
itemCount: logins.length,
itemBuilder: (context,index){
return ItemAcesso(
index: index,
check: logins[index].CHECK,
ID_USUARIO: logins[index].ID_USUARIO,
CADASTRADO_POR: logins[index].CADASTRADO_POR,
@@ -310,19 +335,6 @@ class _HomeScreenState extends State<HomeScreen> {
inserirAcessos(index);
}
);
// return Row(
// children: [
// Checkbox(
// value: logins[index].CHECK,
// onChanged: (v){
// buscandoDados = true;
// setState(()=>logins[index].CHECK=v!);
// inserirAcessos(index);
// }
// ),
// TextCustom(text: logins[index].ID_USUARIO),
// ],
// );
},
),
)
@@ -330,21 +342,36 @@ class _HomeScreenState extends State<HomeScreen> {
):ListView(
children: [
SizedBox(height: height*0.05),
Padding(
padding: EdgeInsets.symmetric(horizontal: width>900?width*0.1:width*0.05),
Container(
margin: EdgeInsets.symmetric(horizontal: width*0.1),
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Container(
height: 35,
width: 70,
alignment: Alignment.center,
child: TextCustom(text: 'BUSCAR',color: Colors.black,size: 12.0),
decoration: BoxDecoration(
borderRadius: BorderRadius.only(topLeft: Radius.circular(3.0),bottomLeft: Radius.circular(3.0),),
color: PaletteColors.greySearch,
border: Border.all(color: PaletteColors.grey)
),
),
InputText(
hint: 'Pesquisar por nome do aluno(a)'.toUpperCase(),
controller: inputPesquisa,
width: width*0.25,
width: width*0.662,
inputFormatters: [],
fontSize: 14,
colorBackground: Colors.white,
borderRadius: 0,
),
SizedBox(width: 10,),
ButtonCustom(
borderRadiusbottomLeft: 0,
borderRadiustopLeft: 0,
borderRadiusbottomRight: 0,
borderRadiustopRight: 0,
widthCustom: 0.05,
text: "PESQUISAR",
fontSize: 10.0,
@@ -362,14 +389,15 @@ class _HomeScreenState extends State<HomeScreen> {
}
},
),
SizedBox(width: 10,),
ButtonCustom(
borderRadiusbottomLeft: 0,
borderRadiustopLeft: 0,
widthCustom: 0.05,
text: "LIMPAR",
fontSize: 10.0,
colorText: PaletteColors.white,
colorButton: PaletteColors.primaryColor,
colorBorder: PaletteColors.primaryColor,
colorButton: PaletteColors.grey,
colorBorder: PaletteColors.grey,
onPressed: ()=>setState((){
inputPesquisa.clear();
resultadoPesquisa.clear();
@@ -380,16 +408,20 @@ class _HomeScreenState extends State<HomeScreen> {
)
),
Container(
margin: EdgeInsets.symmetric(vertical: 20),
padding: EdgeInsets.symmetric(horizontal: width>900?width*0.1:width*0.05),
margin: EdgeInsets.only(top: 20,right: width*0.1,left: width*0.1),
width: width,
alignment: Alignment.center,
decoration: BoxDecoration(
color: PaletteColors.greySearch,
border: Border.all(color: PaletteColors.grey)
),
child: Row(
children: [
Container(
width: width*0.2,
child: Row(
children: [
SizedBox(width: 10,),
TextCustom(text: 'ESTUDANTE',size: 12,fontWeight: FontWeight.bold,color: Colors.black87,),
IconButton(
icon: Icon(filtroEstudante?Icons.arrow_drop_up:Icons.arrow_drop_down,color: filtroEstudante?PaletteColors.primaryColor:PaletteColors.grey,),
@@ -401,7 +433,7 @@ class _HomeScreenState extends State<HomeScreen> {
filtroTurma = false;
filtroEscola = false;
}),
)
),
],
)
),
@@ -420,7 +452,7 @@ class _HomeScreenState extends State<HomeScreen> {
filtroTurma = false;
filtroEscola = false;
}),
)
),
],
)
),
@@ -439,15 +471,15 @@ class _HomeScreenState extends State<HomeScreen> {
filtroTurma = false;
filtroEscola = false;
}),
)
),
],
)
),
Container(
width: width*0.05,
width: width*0.07,
child: Row(
children: [
TextCustom(text: 'Série',size: 12,fontWeight: FontWeight.bold,color: Colors.black87,),
TextCustom(text: 'SÉRIE',size: 12,fontWeight: FontWeight.bold,color: Colors.black87,),
IconButton(
icon: Icon(filtroSerie?Icons.arrow_drop_up:Icons.arrow_drop_down,color: filtroSerie?PaletteColors.primaryColor:PaletteColors.grey,),
onPressed: ()=>setState((){
@@ -458,15 +490,15 @@ class _HomeScreenState extends State<HomeScreen> {
filtroTurma = false;
filtroEscola = false;
}),
)
),
],
)
),
Container(
width: width*0.05,
width: width*0.07,
child: Row(
children: [
TextCustom(text: 'Turma',size: 12,fontWeight: FontWeight.bold,color: Colors.black87,),
TextCustom(text: 'TURMA',size: 12,fontWeight: FontWeight.bold,color: Colors.black87,),
IconButton(
icon: Icon(filtroTurma?Icons.arrow_drop_up:Icons.arrow_drop_down,color: filtroTurma?PaletteColors.primaryColor:PaletteColors.grey,),
onPressed: ()=>setState((){
@@ -477,7 +509,7 @@ class _HomeScreenState extends State<HomeScreen> {
filtroEstudante = false;
filtroEscola = false;
}),
)
),
],
)
),
@@ -485,7 +517,7 @@ class _HomeScreenState extends State<HomeScreen> {
width: width*0.2,
child: Row(
children: [
TextCustom(text: 'Escola',size: 12,fontWeight: FontWeight.bold,color: Colors.black87,),
TextCustom(text: 'ESCOLA',size: 12,fontWeight: FontWeight.bold,color: Colors.black87,),
IconButton(
icon: Icon(filtroEscola?Icons.arrow_drop_up:Icons.arrow_drop_down,color: filtroEscola?PaletteColors.primaryColor:PaletteColors.grey,),
onPressed: ()=>setState((){
@@ -496,7 +528,7 @@ class _HomeScreenState extends State<HomeScreen> {
filtroTurma = false;
filtroEstudante = false;
}),
)
),
],
)
),
@@ -504,19 +536,18 @@ class _HomeScreenState extends State<HomeScreen> {
),
),
Container(
padding: EdgeInsets.symmetric(horizontal: width>900?width*0.1:width*0.05),
decoration: BoxDecoration(
border: Border.all(color: resultadoPesquisa.length==0?Colors.white:PaletteColors.grey)
),
margin: EdgeInsets.symmetric(horizontal: width>900?width*0.1:width*0.05),
width: width*0.75,
height: height*0.8,
child: ListView.separated(
separatorBuilder: (context,index){
return Divider();
},
height: height*0.77,
child: ListView.builder(
itemCount: resultadoPesquisa.length,
itemBuilder:(context,index){
final items = filtroEstudante||filtroData||filtroRA||filtroSerie||filtroTurma||filtroEscola?resultadoPesquisa.reversed.toList():resultadoPesquisa;
return DadosAlunosContainer(alunoModel: items[index]);
return DadosAlunosContainer(alunoModel: items[index],index: index,);
}
),
)