ajustes de layout
This commit is contained in:
@@ -2,8 +2,8 @@ import 'package:educa_controle_acesso/utils/colors.dart';
|
||||
import 'package:educa_controle_acesso/widgets/input_text.dart';
|
||||
import 'package:educa_controle_acesso/widgets/text_custom.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../models/aluno_model.dart';
|
||||
import '../widgets/buttom_custom.dart';
|
||||
import '../widgets/dados_alunos_container.dart';
|
||||
|
||||
class HomeScreen extends StatefulWidget {
|
||||
@@ -18,10 +18,18 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||
var controllerPesquisa = TextEditingController();
|
||||
List<AlunoModel> alunos = [];
|
||||
List resultadoPesquisa = [];
|
||||
bool filtroEstudante = false;
|
||||
bool filtroData = false;
|
||||
bool filtroRA = false;
|
||||
bool filtroSerie = false;
|
||||
bool filtroTurma = false;
|
||||
bool filtroEscola = false;
|
||||
|
||||
carregarAlunos(){
|
||||
alunos.add(AlunoModel(nome: 'Maria da Silva', data_nasc: '01/01/2010', ra: '000.000.000-8', escola: 'EMEI Profª Therezinha de Jesus Alguz', serie: '8', turma: 'A'));
|
||||
alunos.add(AlunoModel(nome: 'Pedro Costa Almeida', data_nasc: '01/01/2015', ra: '111.111.111-5', escola: 'EMEI Profª Enestina Loureiro Miranda', serie: '7', turma: 'C'));
|
||||
alunos=[
|
||||
AlunoModel(nome: 'Maria da Silva', data_nasc: '01/01/2010', ra: '000.000.000-8', escola: 'EMEI Profª Therezinha de Jesus Alguz', serie: '8', turma: 'A'),
|
||||
AlunoModel(nome: 'Pedro Costa Almeida', data_nasc: '01/01/2015', ra: '111.111.111-5', escola: 'EMEI Profª Enestina Loureiro Miranda', serie: '7', turma: 'C')
|
||||
];
|
||||
pesquisarAluno();
|
||||
}
|
||||
|
||||
@@ -47,8 +55,14 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||
}
|
||||
}
|
||||
}else{
|
||||
for(int i = 0;i<10;i++){
|
||||
resultadoPesquisa.add(alunos[i]);
|
||||
if(alunos.length<10){
|
||||
for(int i = 0;i<alunos.length;i++){
|
||||
resultadoPesquisa.add(alunos[i]);
|
||||
}
|
||||
}else{
|
||||
for(int i = 0;i<10;i++){
|
||||
resultadoPesquisa.add(alunos[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
setState(() {});
|
||||
@@ -74,7 +88,7 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||
Container(
|
||||
child: Image.asset("assets/images/logoEduca.png",width:width * 0.08,height: height * 0.12)
|
||||
),
|
||||
TextCustom(text: '- Pesquisar aluno',color: Colors.white,),
|
||||
TextCustom(text: '- PESQUISAR ALUNO',color: Colors.white,),
|
||||
],
|
||||
),
|
||||
backgroundColor: PaletteColors.grey,
|
||||
@@ -85,20 +99,169 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||
children: [
|
||||
SizedBox(height: height*0.05),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: width>900?width*0.3:width*0.05),
|
||||
child: InputText(controller: controllerPesquisa, width: width*0.2,title: 'Pesquisar Aluno(a)',inputFormatters: [],)
|
||||
padding: EdgeInsets.symmetric(horizontal: width>900?width*0.15:width*0.05),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
InputText(
|
||||
hint: 'Pesquisar por estudante, RA ou data de nascimento'.toUpperCase(),
|
||||
controller: controllerPesquisa,
|
||||
width: width*0.25,
|
||||
inputFormatters: [],
|
||||
fontSize: 12,
|
||||
colorBackground: Colors.white,
|
||||
),
|
||||
ButtonCustom(
|
||||
widthCustom: 0.05,
|
||||
heightCustom: 0.063,
|
||||
text: "LIMPAR",
|
||||
size: 10.0,
|
||||
colorText: PaletteColors.white,
|
||||
colorButton: PaletteColors.primaryColor,
|
||||
colorBorder: PaletteColors.primaryColor,
|
||||
onPressed: ()=>setState(()=>controllerPesquisa.clear()),
|
||||
)
|
||||
],
|
||||
)
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: width>900?width*0.3:width*0.05),
|
||||
margin: EdgeInsets.symmetric(vertical: 20),
|
||||
padding: EdgeInsets.symmetric(horizontal: width>900?width*0.15:width*0.05),
|
||||
width: width,
|
||||
alignment: Alignment.center,
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
width: width*0.2,
|
||||
child: Row(
|
||||
children: [
|
||||
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,),
|
||||
onPressed: ()=>setState((){
|
||||
filtroEstudante?filtroEstudante=false:filtroEstudante=true;
|
||||
filtroData = false;
|
||||
filtroRA = false;
|
||||
filtroSerie = false;
|
||||
filtroTurma = false;
|
||||
filtroEscola = false;
|
||||
}),
|
||||
)
|
||||
],
|
||||
)
|
||||
),
|
||||
Container(
|
||||
width: width*0.1,
|
||||
child: Row(
|
||||
children: [
|
||||
TextCustom(text: 'DATA DE NASCIMENTO',size: 12,fontWeight: FontWeight.bold,color: Colors.black87,),
|
||||
IconButton(
|
||||
icon: Icon(filtroData?Icons.arrow_drop_up:Icons.arrow_drop_down,color: filtroData?PaletteColors.primaryColor:PaletteColors.grey,),
|
||||
onPressed: ()=>setState((){
|
||||
filtroData?filtroData=false:filtroData=true;
|
||||
filtroEstudante = false;
|
||||
filtroRA = false;
|
||||
filtroSerie = false;
|
||||
filtroTurma = false;
|
||||
filtroEscola = false;
|
||||
}),
|
||||
)
|
||||
],
|
||||
)
|
||||
),
|
||||
Container(
|
||||
width: width*0.08,
|
||||
child: Row(
|
||||
children: [
|
||||
TextCustom(text: 'RA',size: 12,fontWeight: FontWeight.bold,color: Colors.black87,),
|
||||
IconButton(
|
||||
icon: Icon(filtroRA?Icons.arrow_drop_up:Icons.arrow_drop_down,color: filtroRA?PaletteColors.primaryColor:PaletteColors.grey,),
|
||||
onPressed: ()=>setState((){
|
||||
filtroRA?filtroRA=false:filtroRA=true;
|
||||
filtroData = false;
|
||||
filtroEstudante = false;
|
||||
filtroSerie = false;
|
||||
filtroTurma = false;
|
||||
filtroEscola = false;
|
||||
}),
|
||||
)
|
||||
],
|
||||
)
|
||||
),
|
||||
Container(
|
||||
width: width*0.05,
|
||||
child: Row(
|
||||
children: [
|
||||
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((){
|
||||
filtroSerie?filtroSerie=false:filtroSerie=true;
|
||||
filtroData = false;
|
||||
filtroRA = false;
|
||||
filtroEstudante = false;
|
||||
filtroTurma = false;
|
||||
filtroEscola = false;
|
||||
}),
|
||||
)
|
||||
],
|
||||
)
|
||||
),
|
||||
Container(
|
||||
width: width*0.05,
|
||||
child: Row(
|
||||
children: [
|
||||
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((){
|
||||
filtroTurma?filtroTurma=false:filtroTurma=true;
|
||||
filtroData = false;
|
||||
filtroRA = false;
|
||||
filtroSerie = false;
|
||||
filtroEstudante = false;
|
||||
filtroEscola = false;
|
||||
}),
|
||||
)
|
||||
],
|
||||
)
|
||||
),
|
||||
Container(
|
||||
width: width*0.15,
|
||||
child: Row(
|
||||
children: [
|
||||
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((){
|
||||
filtroEscola?filtroEscola=false:filtroEscola=true;
|
||||
filtroData = false;
|
||||
filtroRA = false;
|
||||
filtroSerie = false;
|
||||
filtroTurma = false;
|
||||
filtroEstudante = false;
|
||||
}),
|
||||
)
|
||||
],
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: width>900?width*0.15:width*0.05),
|
||||
width: width*0.5,
|
||||
height: height*0.5,
|
||||
height: height*0.8,
|
||||
child: ListView.separated(
|
||||
separatorBuilder: (context,index){
|
||||
return Divider();
|
||||
},
|
||||
itemCount: resultadoPesquisa.length,
|
||||
itemBuilder:(context,index){
|
||||
return DadosAlunosContainer(alunoModel: resultadoPesquisa[index],);
|
||||
|
||||
final items = filtroEstudante||filtroData||filtroRA||filtroSerie||filtroTurma||filtroEscola?resultadoPesquisa.reversed.toList():resultadoPesquisa;
|
||||
|
||||
return DadosAlunosContainer(alunoModel: items[index]);
|
||||
}
|
||||
),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user