inserido acesso dos usuários
This commit is contained in:
@@ -6,6 +6,7 @@ class AlunoModel{
|
|||||||
String serie;
|
String serie;
|
||||||
String turma;
|
String turma;
|
||||||
String cidade;
|
String cidade;
|
||||||
|
String login;
|
||||||
var dados;
|
var dados;
|
||||||
|
|
||||||
AlunoModel({
|
AlunoModel({
|
||||||
@@ -16,6 +17,7 @@ class AlunoModel{
|
|||||||
required this.serie,
|
required this.serie,
|
||||||
required this.turma,
|
required this.turma,
|
||||||
required this.dados,
|
required this.dados,
|
||||||
required this.cidade
|
required this.cidade,
|
||||||
|
required this.login,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,17 @@
|
|||||||
class LoginModel{
|
class LoginModel{
|
||||||
String login;
|
bool CHECK;
|
||||||
bool check;
|
String ID_USUARIO;
|
||||||
|
String DATA;
|
||||||
|
String CADASTRADO_POR;
|
||||||
|
String CIDADE;
|
||||||
|
String STATUS;
|
||||||
|
|
||||||
LoginModel({
|
LoginModel({
|
||||||
required this.login,
|
required this.CHECK,
|
||||||
required this.check,
|
required this.ID_USUARIO,
|
||||||
|
required this.DATA,
|
||||||
|
required this.CADASTRADO_POR,
|
||||||
|
required this.CIDADE,
|
||||||
|
required this.STATUS
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'package:educa_controle_acesso/utils/colors.dart';
|
import 'package:educa_controle_acesso/utils/colors.dart';
|
||||||
import 'package:educa_controle_acesso/widgets/input_text.dart';
|
import 'package:educa_controle_acesso/widgets/input_text.dart';
|
||||||
|
import 'package:educa_controle_acesso/widgets/item_acesso.dart';
|
||||||
import 'package:educa_controle_acesso/widgets/text_custom.dart';
|
import 'package:educa_controle_acesso/widgets/text_custom.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import '../models/aluno_model.dart';
|
import '../models/aluno_model.dart';
|
||||||
@@ -33,6 +34,8 @@ class _HomeScreenState extends State<HomeScreen> {
|
|||||||
bool buscandoDados = false;
|
bool buscandoDados = false;
|
||||||
bool showEscola = false;
|
bool showEscola = false;
|
||||||
|
|
||||||
|
String mensagem = 'BUSCANDO DADOS ...';
|
||||||
|
|
||||||
carregarAlunos()async{
|
carregarAlunos()async{
|
||||||
resultadoPesquisa.clear();
|
resultadoPesquisa.clear();
|
||||||
alunos.clear();
|
alunos.clear();
|
||||||
@@ -70,7 +73,8 @@ class _HomeScreenState extends State<HomeScreen> {
|
|||||||
serie: list[i]['DESC_SERIE'],
|
serie: list[i]['DESC_SERIE'],
|
||||||
turma: list[i]['TURMA'],
|
turma: list[i]['TURMA'],
|
||||||
dados: list[i],
|
dados: list[i],
|
||||||
cidade: widget.dados[0]
|
cidade: widget.dados[0],
|
||||||
|
login: widget.dados[1]
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
resultadoPesquisa.add(alunos[i]);
|
resultadoPesquisa.add(alunos[i]);
|
||||||
@@ -81,60 +85,61 @@ class _HomeScreenState extends State<HomeScreen> {
|
|||||||
setState(() {
|
setState(() {
|
||||||
buscandoDados = false;
|
buscandoDados = false;
|
||||||
});
|
});
|
||||||
// pesquisarAluno();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// pesquisa(){
|
getAcessosMariaDB()async{
|
||||||
// pesquisarAluno();
|
|
||||||
// }
|
|
||||||
|
|
||||||
// pesquisarAluno()async{
|
|
||||||
// resultadoPesquisa =[];
|
|
||||||
// if(inputPesquisa.text.isNotEmpty){
|
|
||||||
// for (int i =0;alunos.length>i;i++) {
|
|
||||||
// String nome = alunos[i].nome.toUpperCase();
|
|
||||||
// String data = alunos[i].data_nasc.toUpperCase();
|
|
||||||
// String ra = alunos[i].ra.toUpperCase();
|
|
||||||
//
|
|
||||||
// if(nome.contains(inputPesquisa.text.toUpperCase()) ||
|
|
||||||
// data.contains(inputPesquisa.text.toUpperCase()) ||
|
|
||||||
// ra.contains(inputPesquisa.text.toUpperCase())
|
|
||||||
// ){
|
|
||||||
// if(resultadoPesquisa.length<10){
|
|
||||||
// resultadoPesquisa.add(alunos[i]);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }else{
|
|
||||||
// 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(() {});
|
|
||||||
// }
|
|
||||||
|
|
||||||
getAcessos()async{
|
|
||||||
logins.clear();
|
logins.clear();
|
||||||
setState(() {
|
setState(() {
|
||||||
buscandoDados = true;
|
buscandoDados = true;
|
||||||
});
|
});
|
||||||
final url = 'http://192.168.18.2:8000/acesso?LOGIN=${inputPesquisa.text}&CIDADE=${widget.dados[0]}';
|
final url = 'http://192.168.18.2:8000/acesso_maria?LOGIN=${inputPesquisa.text.toUpperCase()}&CIDADE=${widget.dados[0]}';
|
||||||
print(url);
|
print(url);
|
||||||
final response = await http.get(Uri.parse(url));
|
final response = await http.get(Uri.parse(url));
|
||||||
var map = json.decode(response.body);
|
var map = json.decode(response.body);
|
||||||
print(map);
|
print(map);
|
||||||
List list = map;
|
List list = map;
|
||||||
|
if(list.length != 0 ){
|
||||||
for(int i=0;list.length>i;i++){
|
for(int i=0;list.length>i;i++){
|
||||||
logins.add(LoginModel(login: list[i]['NO_USERNAME'],check: false));
|
logins.add(
|
||||||
|
LoginModel(
|
||||||
|
ID_USUARIO: list[i]['ID_USUARIO'],
|
||||||
|
CHECK:list[i]['CONDICAO']=='1'?true: false,
|
||||||
|
STATUS: 'CADASTRADO',
|
||||||
|
CADASTRADO_POR:list[i]['CADASTRADO_POR'],
|
||||||
|
CIDADE: list[i]['CIDADE'],
|
||||||
|
DATA: list[i]['DATA']
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
setState(() {
|
||||||
|
buscandoDados = false;
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
getAcessosBasePrincipal();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getAcessosBasePrincipal()async{
|
||||||
|
logins.clear();
|
||||||
|
setState(() {
|
||||||
|
buscandoDados = true;
|
||||||
|
});
|
||||||
|
final url = 'http://192.168.18.2:8000/acesso_base?LOGIN=${inputPesquisa.text.toUpperCase()}&CIDADE=${widget.dados[0]}';
|
||||||
|
print(url);
|
||||||
|
final response = await http.get(Uri.parse(url));
|
||||||
|
var map = json.decode(response.body);
|
||||||
|
print(map);
|
||||||
|
List list = map;
|
||||||
|
if(list.length!=0){
|
||||||
|
for(int i=0;list.length>i;i++){
|
||||||
|
if(list[i]['NO_USERNAME']!='ADMIN'){
|
||||||
|
logins.add(LoginModel(ID_USUARIO: list[i]['NO_USERNAME'],CHECK: false,STATUS: 'NOVO',CIDADE: widget.dados[0],CADASTRADO_POR: 'NÃO CADASTRADO',DATA: '00/00/0000'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
showSnackBar(context, 'NENHUM USUÁRIO ENCONTRADO!', Colors.red);
|
||||||
|
}
|
||||||
setState(() {
|
setState(() {
|
||||||
buscandoDados = false;
|
buscandoDados = false;
|
||||||
});
|
});
|
||||||
@@ -146,17 +151,16 @@ class _HomeScreenState extends State<HomeScreen> {
|
|||||||
Uri.parse(url),
|
Uri.parse(url),
|
||||||
body:{
|
body:{
|
||||||
'DATA' : DateTime.now().toString(),
|
'DATA' : DateTime.now().toString(),
|
||||||
'CONDICAO': logins[index].check?"1":"2",
|
'CONDICAO': logins[index].CHECK?"1":"2",
|
||||||
'CADASTRADO_POR': widget.dados[1].toString().toUpperCase(),
|
'CADASTRADO_POR': widget.dados[1].toString().toUpperCase(),
|
||||||
'ID_USUARIO' : logins[index].login,
|
'ID_USUARIO' : logins[index].ID_USUARIO,
|
||||||
'CIDADE': widget.dados[0],
|
'CIDADE': widget.dados[0],
|
||||||
'NOVO' : 'NAO'
|
'NOVO' : logins[index].STATUS == 'NOVO'? 'SIM':'NAO'
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
print(response.body);
|
// print(response.body);
|
||||||
if(response.body == 'cadastrado com sucesso' || response.body == 'editado com sucesso'){
|
showSnackBar(context, '${response.body.toUpperCase()}!', Colors.green);
|
||||||
showSnackBar(context, '${response.body}!', Colors.green);
|
logins[index].STATUS == 'NAO';
|
||||||
}
|
|
||||||
buscandoDados = false;
|
buscandoDados = false;
|
||||||
setState(() {});
|
setState(() {});
|
||||||
}
|
}
|
||||||
@@ -174,11 +178,14 @@ class _HomeScreenState extends State<HomeScreen> {
|
|||||||
Container(
|
Container(
|
||||||
child: Image.asset("assets/images/logoEduca.png",width:width * 0.08,height: height * 0.12)
|
child: Image.asset("assets/images/logoEduca.png",width:width * 0.08,height: height * 0.12)
|
||||||
),
|
),
|
||||||
TextCustom(text: '- PESQUISAR ALUNO',color: Colors.white,),
|
TextCustom(text: showEscola?'- PESQUISAR USUÁRIOS':'- PESQUISAR ESTUDANTES',color: Colors.white,),
|
||||||
Spacer(),
|
Spacer(),
|
||||||
widget.dados[1].toString().toUpperCase()=='ADMIN'?ButtonCustom(
|
widget.dados[1].toString().toUpperCase()=='ADMIN'?ButtonCustom(
|
||||||
onPressed: ()=>setState(()=>showEscola?showEscola=false:showEscola=true),
|
onPressed: (){
|
||||||
text: showEscola?'Acesso Pais':'Acesso Escola',
|
inputPesquisa.clear();
|
||||||
|
setState(()=>showEscola?showEscola=false:showEscola=true);
|
||||||
|
},
|
||||||
|
text: showEscola?'Cadastrar Pais':'Cadastrar Usuários',
|
||||||
size: 15,
|
size: 15,
|
||||||
widthCustom: 0.1,
|
widthCustom: 0.1,
|
||||||
heightCustom: 0.05,
|
heightCustom: 0.05,
|
||||||
@@ -187,7 +194,8 @@ class _HomeScreenState extends State<HomeScreen> {
|
|||||||
colorBorder: PaletteColors.white
|
colorBorder: PaletteColors.white
|
||||||
):Container(),
|
):Container(),
|
||||||
SizedBox(width: width * 0.02),
|
SizedBox(width: width * 0.02),
|
||||||
TextCustom(text: widget.dados[0]==null?'':widget.dados[0],color: Colors.white,)
|
TextCustom(text: widget.dados[0]==null?'':widget.dados[0],color: Colors.white,),
|
||||||
|
TextCustom(text:widget.dados[1]==null?'':' - '+widget.dados[1].toString().toUpperCase(),color: Colors.white,),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
backgroundColor: PaletteColors.grey,
|
backgroundColor: PaletteColors.grey,
|
||||||
@@ -198,7 +206,7 @@ class _HomeScreenState extends State<HomeScreen> {
|
|||||||
children: [
|
children: [
|
||||||
CircularProgressIndicator(),
|
CircularProgressIndicator(),
|
||||||
SizedBox(width: 20,),
|
SizedBox(width: 20,),
|
||||||
TextCustom(text: 'BUSCANDO DADOS...')
|
TextCustom(text: mensagem)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
):Padding(
|
):Padding(
|
||||||
@@ -232,7 +240,8 @@ class _HomeScreenState extends State<HomeScreen> {
|
|||||||
setState(() {
|
setState(() {
|
||||||
buscandoDados = true;
|
buscandoDados = true;
|
||||||
});
|
});
|
||||||
getAcessos();
|
// getAcessosBasePrincipal();
|
||||||
|
getAcessosMariaDB();
|
||||||
}else{
|
}else{
|
||||||
showSnackBar(context, 'Digite alguma informação para pesquisar', Colors.red);
|
showSnackBar(context, 'Digite alguma informação para pesquisar', Colors.red);
|
||||||
}
|
}
|
||||||
@@ -256,24 +265,64 @@ class _HomeScreenState extends State<HomeScreen> {
|
|||||||
)
|
)
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
|
margin: EdgeInsets.symmetric(vertical: 20),
|
||||||
padding: EdgeInsets.symmetric(horizontal: width>900?width*0.1:width*0.05),
|
padding: EdgeInsets.symmetric(horizontal: width>900?width*0.1:width*0.05),
|
||||||
height: height*0.2,
|
width: width,
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
SizedBox(width: 30,),
|
||||||
|
Container(
|
||||||
|
width: width*0.1,
|
||||||
|
child: TextCustom(text: 'USUÁRIO',size: 12,fontWeight: FontWeight.bold,color: Colors.black87,),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: width*0.1,
|
||||||
|
child: TextCustom(text: 'DATA DO CADASTRO',size: 12,fontWeight: FontWeight.bold,color: Colors.black87,),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: width*0.1,
|
||||||
|
child: TextCustom(text: 'CADASTRADO POR',size: 12,fontWeight: FontWeight.bold,color: Colors.black87,),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: width*0.1,
|
||||||
|
child: TextCustom(text: 'BASE',size: 12,fontWeight: FontWeight.bold,color: Colors.black87,),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: width>900?width*0.1:width*0.05),
|
||||||
|
height: height*0.7,
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
itemCount: logins.length,
|
itemCount: logins.length,
|
||||||
itemBuilder: (context,index){
|
itemBuilder: (context,index){
|
||||||
return Row(
|
return ItemAcesso(
|
||||||
children: [
|
check: logins[index].CHECK,
|
||||||
Checkbox(
|
ID_USUARIO: logins[index].ID_USUARIO,
|
||||||
value: logins[index].check,
|
CADASTRADO_POR: logins[index].CADASTRADO_POR,
|
||||||
|
CIDADE: logins[index].CIDADE,
|
||||||
|
DATA: logins[index].DATA,
|
||||||
onChanged: (v){
|
onChanged: (v){
|
||||||
buscandoDados = true;
|
buscandoDados = true;
|
||||||
setState(()=>logins[index].check=v!);
|
mensagem = 'SALVANDO DADOS ...';
|
||||||
|
setState(()=>logins[index].CHECK=v!);
|
||||||
inserirAcessos(index);
|
inserirAcessos(index);
|
||||||
}
|
}
|
||||||
),
|
|
||||||
TextCustom(text: logins[index].login),
|
|
||||||
],
|
|
||||||
);
|
);
|
||||||
|
// 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),
|
||||||
|
// ],
|
||||||
|
// );
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
final inputLogin = TextEditingController(text: 'admin');
|
final inputLogin = TextEditingController(text: 'admin');
|
||||||
final inputSenha = TextEditingController(text: 'las1594@@');
|
final inputSenha = TextEditingController(text: 'las1594@@');
|
||||||
final inputCodigo = TextEditingController(text: 'e003');
|
final inputCodigo = TextEditingController(text: 'e003');
|
||||||
bool loading = false;
|
bool carregando = false;
|
||||||
List listCodigo = [];
|
List listCodigo = [];
|
||||||
|
|
||||||
carregarLista(){
|
carregarLista(){
|
||||||
@@ -39,9 +39,13 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
if(inputCodigo.text.isNotEmpty){
|
if(inputCodigo.text.isNotEmpty){
|
||||||
if(listCodigo.contains(inputCodigo.text.toUpperCase())){
|
if(listCodigo.contains(inputCodigo.text.toUpperCase())){
|
||||||
setState(() {
|
setState(() {
|
||||||
loading = true;
|
carregando = true;
|
||||||
});
|
});
|
||||||
|
if(inputLogin.text.toUpperCase() == 'ADMIN'){
|
||||||
conectAPI();
|
conectAPI();
|
||||||
|
}else{
|
||||||
|
getAcessosMariaDB();
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
showSnackBar(context, 'Código inválido', Colors.red);
|
showSnackBar(context, 'Código inválido', Colors.red);
|
||||||
}
|
}
|
||||||
@@ -56,6 +60,38 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getAcessosMariaDB()async{
|
||||||
|
String cidade = '';
|
||||||
|
for(int i =0; Cidades().listCidades.length>i;i++){
|
||||||
|
if(Cidades().listCidades[i].codigo == inputCodigo.text.toUpperCase()){
|
||||||
|
cidade = Cidades().listCidades[i].cidadeQuery.toUpperCase();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
final url = 'http://192.168.18.2:8000/acesso_maria?LOGIN=${inputLogin.text.toUpperCase()}&CIDADE=$cidade';
|
||||||
|
print(url);
|
||||||
|
final response = await http.get(Uri.parse(url));
|
||||||
|
var map = json.decode(response.body);
|
||||||
|
print(map);
|
||||||
|
List list = map;
|
||||||
|
if(list.length != 0 ){
|
||||||
|
for(int i=0;list.length>i;i++){
|
||||||
|
if(list[i]['ID_USUARIO']==inputLogin.text.toUpperCase() &&list[i]['CONDICAO']=='1'){
|
||||||
|
conectAPI();
|
||||||
|
}else{
|
||||||
|
setState(() {
|
||||||
|
carregando = false;
|
||||||
|
});
|
||||||
|
showSnackBar(context, 'Login seu acesso não está liberado!', Colors.red);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
setState(() {
|
||||||
|
carregando = false;
|
||||||
|
});
|
||||||
|
showSnackBar(context, 'Login não cadastrado e/ou senha incorreta e/ou Código incorreto', Colors.red);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
conectAPI()async{
|
conectAPI()async{
|
||||||
|
|
||||||
String cidade = '';
|
String cidade = '';
|
||||||
@@ -71,7 +107,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
var map = json.decode(response.body);
|
var map = json.decode(response.body);
|
||||||
// print(map);
|
// print(map);
|
||||||
if(map==false){
|
if(map==false){
|
||||||
showSnackBar(context, 'Login não cadastrado e/ou senha incorreta', Colors.red);
|
showSnackBar(context, 'Login não cadastrado e/ou senha incorreta e/ou Código incorreto', Colors.red);
|
||||||
}else{
|
}else{
|
||||||
if(map['NO_USERNAME']==map['SENHA']){
|
if(map['NO_USERNAME']==map['SENHA']){
|
||||||
if(map['NO_USERNAME']==inputLogin.text.toUpperCase() && map['SENHA']==inputSenha.text.toUpperCase()){
|
if(map['NO_USERNAME']==inputLogin.text.toUpperCase() && map['SENHA']==inputSenha.text.toUpperCase()){
|
||||||
@@ -79,7 +115,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
List dados = [cidade,inputLogin.text];
|
List dados = [cidade,inputLogin.text];
|
||||||
Navigator.pushNamed(context, '/home',arguments: dados);
|
Navigator.pushNamed(context, '/home',arguments: dados);
|
||||||
}else{
|
}else{
|
||||||
showSnackBar(context, 'Login não cadastrado e/ou senha incorreta', Colors.red);
|
showSnackBar(context, 'Login não cadastrado e/ou senha incorreta e/ou Código incorreto', Colors.red);
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
if(MainControllers().encrypt(inputSenha.text,map['SENHA']) == map['SENHA']){
|
if(MainControllers().encrypt(inputSenha.text,map['SENHA']) == map['SENHA']){
|
||||||
@@ -87,12 +123,12 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
List dados = [cidade,inputLogin.text];
|
List dados = [cidade,inputLogin.text];
|
||||||
Navigator.pushNamed(context, '/home',arguments: dados);
|
Navigator.pushNamed(context, '/home',arguments: dados);
|
||||||
}else{
|
}else{
|
||||||
showSnackBar(context, 'Login não cadastrado e/ou senha incorreta', Colors.red);
|
showSnackBar(context, 'Login não cadastrado e/ou senha incorreta e/ou Código incorreto', Colors.red);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
setState(() {
|
setState(() {
|
||||||
loading = false;
|
carregando = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -116,7 +152,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
Container(
|
Container(
|
||||||
child: Image.asset("assets/images/logoEduca.png",width:width * 0.15,height: height * 0.12)
|
child: Image.asset("assets/images/logoEduca.png",width:width * 0.15,height: height * 0.12)
|
||||||
),
|
),
|
||||||
loading?Container():Container(
|
carregando?Container():Container(
|
||||||
width: width>900? width * 0.18:width*0.5,
|
width: width>900? width * 0.18:width*0.5,
|
||||||
child: InputText(
|
child: InputText(
|
||||||
inputFormatters: [],
|
inputFormatters: [],
|
||||||
@@ -127,7 +163,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: height * 0.02),
|
SizedBox(height: height * 0.02),
|
||||||
loading?Container():Container(
|
carregando?Container():Container(
|
||||||
width: width>900? width * 0.18:width*0.5,
|
width: width>900? width * 0.18:width*0.5,
|
||||||
child: InputText(
|
child: InputText(
|
||||||
inputFormatters: [],
|
inputFormatters: [],
|
||||||
@@ -139,7 +175,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: height * 0.02),
|
SizedBox(height: height * 0.02),
|
||||||
loading?Container():Container(
|
carregando?Container():Container(
|
||||||
width: width>900? width * 0.18:width*0.5,
|
width: width>900? width * 0.18:width*0.5,
|
||||||
child: InputText(
|
child: InputText(
|
||||||
inputFormatters: [],
|
inputFormatters: [],
|
||||||
@@ -150,7 +186,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: height * 0.02),
|
SizedBox(height: height * 0.02),
|
||||||
loading?Row(
|
carregando?Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
CircularProgressIndicator(),
|
CircularProgressIndicator(),
|
||||||
|
|||||||
@@ -243,6 +243,9 @@ class _ResponsibleRegisterScreenState extends State<ResponsibleRegisterScreen> {
|
|||||||
child: Image.asset("assets/images/logoEduca.png",width:width * 0.08,height: height * 0.12)
|
child: Image.asset("assets/images/logoEduca.png",width:width * 0.08,height: height * 0.12)
|
||||||
),
|
),
|
||||||
TextCustom(text: '- Cadastrar Responsável',color: Colors.white,),
|
TextCustom(text: '- Cadastrar Responsável',color: Colors.white,),
|
||||||
|
Spacer(),
|
||||||
|
TextCustom(text: widget.alunoModel.cidade,color: Colors.white,),
|
||||||
|
TextCustom(text:' - '+ widget.alunoModel.login.toUpperCase(),color: Colors.white,),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
backgroundColor: PaletteColors.grey,
|
backgroundColor: PaletteColors.grey,
|
||||||
|
|||||||
54
lib/widgets/item_acesso.dart
Normal file
54
lib/widgets/item_acesso.dart
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
import 'package:educa_controle_acesso/widgets/text_custom.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:intl/intl.dart';
|
||||||
|
|
||||||
|
class ItemAcesso extends StatelessWidget {
|
||||||
|
bool check;
|
||||||
|
String ID_USUARIO;
|
||||||
|
String DATA;
|
||||||
|
String CADASTRADO_POR;
|
||||||
|
String CIDADE;
|
||||||
|
var onChanged;
|
||||||
|
|
||||||
|
ItemAcesso({
|
||||||
|
required this.check,
|
||||||
|
required this.ID_USUARIO,
|
||||||
|
required this.DATA,
|
||||||
|
required this.CADASTRADO_POR,
|
||||||
|
required this.CIDADE,
|
||||||
|
required this.onChanged
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
|
||||||
|
double width = MediaQuery.of(context).size.width;
|
||||||
|
|
||||||
|
String formataData = DATA == '00/00/0000'?'00/00/0000': DateFormat('dd/MM/yyyy hh:mm').format(DateTime.parse(DATA));
|
||||||
|
|
||||||
|
return Row(
|
||||||
|
children: [
|
||||||
|
Checkbox(
|
||||||
|
value: check,
|
||||||
|
onChanged:onChanged
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: width*0.1,
|
||||||
|
child: TextCustom(text: ID_USUARIO)
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: width*0.1,
|
||||||
|
child: TextCustom(text: formataData)
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: width*0.1,
|
||||||
|
child: TextCustom(text: CADASTRADO_POR)
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: width*0.1,
|
||||||
|
child: TextCustom(text: CIDADE)
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user