criada a tela responsible_register_screen.dart, o model responsavel_model.dart e feitos outros ajustes
This commit is contained in:
BIN
assets/images/logoEduca.png
Normal file
BIN
assets/images/logoEduca.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 76 KiB |
|
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 55 KiB |
@@ -14,7 +14,7 @@ class MyApp extends StatelessWidget {
|
|||||||
return MaterialApp(
|
return MaterialApp(
|
||||||
debugShowCheckedModeBanner: false,
|
debugShowCheckedModeBanner: false,
|
||||||
title: 'Controle de Acesso',
|
title: 'Controle de Acesso',
|
||||||
home: HomeScreen(),
|
home: LoginScreen(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
25
lib/models/responsavel_model.dart
Normal file
25
lib/models/responsavel_model.dart
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
class ResponsavelModel{
|
||||||
|
String nomeAluno;
|
||||||
|
String raAluno;
|
||||||
|
String escola;
|
||||||
|
String serie;
|
||||||
|
String turma;
|
||||||
|
String nomeResponsavel;
|
||||||
|
String parentesco;
|
||||||
|
String cpf;
|
||||||
|
String senha;
|
||||||
|
String dataCadastro;
|
||||||
|
|
||||||
|
ResponsavelModel({
|
||||||
|
required this.nomeAluno,
|
||||||
|
required this.raAluno,
|
||||||
|
required this.escola,
|
||||||
|
required this.serie,
|
||||||
|
required this.turma,
|
||||||
|
required this.nomeResponsavel,
|
||||||
|
required this.parentesco,
|
||||||
|
required this.cpf,
|
||||||
|
required this.senha,
|
||||||
|
required this.dataCadastro,
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -27,7 +27,6 @@ class _HomeScreenState extends State<HomeScreen> {
|
|||||||
|
|
||||||
pesquisa(){
|
pesquisa(){
|
||||||
pesquisarAluno();
|
pesquisarAluno();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pesquisarAluno()async{
|
pesquisarAluno()async{
|
||||||
@@ -35,7 +34,13 @@ class _HomeScreenState extends State<HomeScreen> {
|
|||||||
if(controllerPesquisa.text.isNotEmpty){
|
if(controllerPesquisa.text.isNotEmpty){
|
||||||
for (int i =0;alunos.length>i;i++) {
|
for (int i =0;alunos.length>i;i++) {
|
||||||
String nome = alunos[i].nome.toUpperCase();
|
String nome = alunos[i].nome.toUpperCase();
|
||||||
if(nome.contains(controllerPesquisa.text.toUpperCase())){
|
String data = alunos[i].data_nasc.toUpperCase();
|
||||||
|
String ra = alunos[i].ra.toUpperCase();
|
||||||
|
|
||||||
|
if(nome.contains(controllerPesquisa.text.toUpperCase()) ||
|
||||||
|
data.contains(controllerPesquisa.text.toUpperCase()) ||
|
||||||
|
ra.contains(controllerPesquisa.text.toUpperCase())
|
||||||
|
){
|
||||||
if(resultadoPesquisa.length<10){
|
if(resultadoPesquisa.length<10){
|
||||||
resultadoPesquisa.add(alunos[i]);
|
resultadoPesquisa.add(alunos[i]);
|
||||||
}
|
}
|
||||||
@@ -63,7 +68,17 @@ class _HomeScreenState extends State<HomeScreen> {
|
|||||||
double height = MediaQuery.of(context).size.height;
|
double height = MediaQuery.of(context).size.height;
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(title: TextCustom(text: 'Cadastrar responsável',color: Colors.white,),backgroundColor: PaletteColors.grey),
|
appBar: AppBar(
|
||||||
|
title: Row(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
child: Image.asset("assets/images/logoEduca.png",width:width * 0.08,height: height * 0.12)
|
||||||
|
),
|
||||||
|
TextCustom(text: '- Pesquisar aluno',color: Colors.white,),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
backgroundColor: PaletteColors.grey,
|
||||||
|
),
|
||||||
body: Padding(
|
body: Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: ListView(
|
child: ListView(
|
||||||
@@ -71,7 +86,7 @@ class _HomeScreenState extends State<HomeScreen> {
|
|||||||
SizedBox(height: height*0.05),
|
SizedBox(height: height*0.05),
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.symmetric(horizontal: width>900?width*0.3:width*0.05),
|
padding: EdgeInsets.symmetric(horizontal: width>900?width*0.3:width*0.05),
|
||||||
child: InputText(controller: controllerPesquisa, width: width*0.2,title: 'Pesquisar Aluno(a)',)
|
child: InputText(controller: controllerPesquisa, width: width*0.2,title: 'Pesquisar Aluno(a)',inputFormatters: [],)
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.symmetric(horizontal: width>900?width*0.3:width*0.05),
|
padding: EdgeInsets.symmetric(horizontal: width>900?width*0.3:width*0.05),
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import 'package:flutter/material.dart';
|
|||||||
import '../utils/colors.dart';
|
import '../utils/colors.dart';
|
||||||
import '../widgets/buttom_custom.dart';
|
import '../widgets/buttom_custom.dart';
|
||||||
import '../widgets/snackBars.dart';
|
import '../widgets/snackBars.dart';
|
||||||
import '../widgets/text_custom.dart';
|
|
||||||
|
|
||||||
class LoginScreen extends StatefulWidget {
|
class LoginScreen extends StatefulWidget {
|
||||||
const LoginScreen({Key? key}) : super(key: key);
|
const LoginScreen({Key? key}) : super(key: key);
|
||||||
@@ -54,11 +53,12 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
child: Image.asset("assets/image/logo.PNG",width:width * 0.2 ,height: height * 0.12)
|
child: Image.asset("assets/images/logoEduca.png",width:width * 0.15,height: height * 0.12)
|
||||||
),
|
),
|
||||||
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: [],
|
||||||
controller: inputEmail,
|
controller: inputEmail,
|
||||||
title: 'E-mail',
|
title: 'E-mail',
|
||||||
width: width>900? width * 0.18:width*0.5,
|
width: width>900? width * 0.18:width*0.5,
|
||||||
@@ -69,6 +69,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
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: [],
|
||||||
controller: inputSenha,
|
controller: inputSenha,
|
||||||
title: 'Senha',
|
title: 'Senha',
|
||||||
obscure: true,
|
obscure: true,
|
||||||
@@ -86,7 +87,6 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
colorButton: PaletteColors.primaryColor,
|
colorButton: PaletteColors.primaryColor,
|
||||||
colorBorder: PaletteColors.primaryColor,
|
colorBorder: PaletteColors.primaryColor,
|
||||||
onPressed: ()=>verificacao(),
|
onPressed: ()=>verificacao(),
|
||||||
font: 'Nunito',
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
288
lib/screens/responsible_register_screen.dart
Normal file
288
lib/screens/responsible_register_screen.dart
Normal file
@@ -0,0 +1,288 @@
|
|||||||
|
import 'package:brasil_fields/brasil_fields.dart';
|
||||||
|
import 'package:educa_controle_acesso/models/aluno_model.dart';
|
||||||
|
import 'package:educa_controle_acesso/models/responsavel_model.dart';
|
||||||
|
import 'package:educa_controle_acesso/widgets/dados_responsaveis_container.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:intl/intl.dart';
|
||||||
|
import '../utils/colors.dart';
|
||||||
|
import '../widgets/buttom_custom.dart';
|
||||||
|
import '../widgets/input_text.dart';
|
||||||
|
import '../widgets/snackBars.dart';
|
||||||
|
import '../widgets/text_custom.dart';
|
||||||
|
|
||||||
|
class ResponsibleRegisterScreen extends StatefulWidget {
|
||||||
|
AlunoModel alunoModel;
|
||||||
|
|
||||||
|
ResponsibleRegisterScreen({required this.alunoModel});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<ResponsibleRegisterScreen> createState() => _ResponsibleRegisterScreenState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _ResponsibleRegisterScreenState extends State<ResponsibleRegisterScreen> {
|
||||||
|
|
||||||
|
List <ResponsavelModel> responsaveis = [];
|
||||||
|
bool showRegister = false;
|
||||||
|
bool editando = false;
|
||||||
|
int? indice;
|
||||||
|
var inputNome = TextEditingController();
|
||||||
|
var inputParentesco = TextEditingController();
|
||||||
|
var inputCpf = TextEditingController();
|
||||||
|
var inputSenha = TextEditingController();
|
||||||
|
var inputData = TextEditingController();
|
||||||
|
|
||||||
|
salvarResponsavel() {
|
||||||
|
if(inputNome.text.isNotEmpty && inputNome.text.contains(' ')){
|
||||||
|
if(inputParentesco.text.isNotEmpty){
|
||||||
|
if(inputCpf.text.isNotEmpty && GetUtils.isCpf(inputCpf.text)){
|
||||||
|
if(inputSenha.text.isNotEmpty && inputSenha.text.length > 5){
|
||||||
|
if(editando && indice!=null){
|
||||||
|
responsaveis[indice!] = ResponsavelModel(
|
||||||
|
nomeAluno: widget.alunoModel.nome,
|
||||||
|
raAluno: widget.alunoModel.ra,
|
||||||
|
escola: widget.alunoModel.escola,
|
||||||
|
serie: widget.alunoModel.serie,
|
||||||
|
turma: widget.alunoModel.turma,
|
||||||
|
nomeResponsavel: inputNome.text,
|
||||||
|
parentesco: inputParentesco.text,
|
||||||
|
cpf: inputCpf.text,
|
||||||
|
senha: inputSenha.text,
|
||||||
|
dataCadastro: DateFormat('dd/MM/yyyy HH:mm').format(DateTime.now())
|
||||||
|
);
|
||||||
|
}else{
|
||||||
|
responsaveis.add(
|
||||||
|
ResponsavelModel(
|
||||||
|
nomeAluno: widget.alunoModel.nome.toUpperCase(),
|
||||||
|
raAluno: widget.alunoModel.ra.toUpperCase(),
|
||||||
|
escola: widget.alunoModel.escola.toUpperCase(),
|
||||||
|
serie: widget.alunoModel.serie.toUpperCase(),
|
||||||
|
turma: widget.alunoModel.turma.toUpperCase(),
|
||||||
|
nomeResponsavel: inputNome.text.toUpperCase(),
|
||||||
|
parentesco: inputParentesco.text.toUpperCase(),
|
||||||
|
cpf: inputCpf.text,
|
||||||
|
senha: inputSenha.text.toUpperCase(),
|
||||||
|
dataCadastro: DateFormat('dd/MM/yyyy HH:mm').format(DateTime.now())
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
editando?
|
||||||
|
showSnackBar(context, 'Responsável alterado!', Colors.green):
|
||||||
|
showSnackBar(context, 'Responsável adicionado!', Colors.green);
|
||||||
|
inputNome.clear();
|
||||||
|
inputParentesco.clear();
|
||||||
|
inputCpf.clear();
|
||||||
|
inputSenha.clear();
|
||||||
|
showRegister = false;
|
||||||
|
editando = false;
|
||||||
|
indice = null;
|
||||||
|
inputData.clear();
|
||||||
|
setState((){});
|
||||||
|
}else{
|
||||||
|
showSnackBar(context, 'Insira o uma senha com o mínimo de 6 caracteres', Colors.red);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
showSnackBar(context, 'CPF inválido', Colors.red);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
showSnackBar(context, 'Insira o parentesco do responsável', Colors.red);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
showSnackBar(context, 'Insira o nome completo do responsável', Colors.red);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
|
||||||
|
double width = MediaQuery.of(context).size.width;
|
||||||
|
double height = MediaQuery.of(context).size.height;
|
||||||
|
|
||||||
|
return Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: Row(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
child: Image.asset("assets/images/logoEduca.png",width:width * 0.08,height: height * 0.12)
|
||||||
|
),
|
||||||
|
TextCustom(text: '- Cadastrar Responsável',color: Colors.white,),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
backgroundColor: PaletteColors.grey,
|
||||||
|
),
|
||||||
|
body: Padding(
|
||||||
|
padding: const EdgeInsets.all(30.0),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
TextCustom(text: 'Aluno(a): ${widget.alunoModel.nome}'),
|
||||||
|
TextCustom(text: 'Turma: ${widget.alunoModel.serie}° ANO ${widget.alunoModel.turma}'),
|
||||||
|
TextCustom(text: 'RA: ${widget.alunoModel.ra}'),
|
||||||
|
TextCustom(text: 'Escola: ${widget.alunoModel.escola}'),
|
||||||
|
SizedBox(height: 50,),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
TextCustom(text: 'Responsáveis Cadastrados:'),
|
||||||
|
IconButton(
|
||||||
|
icon: Icon(Icons.add_circle,color: PaletteColors.primaryColor),
|
||||||
|
onPressed: ()=>setState(()=>showRegister = true),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
showRegister?Container(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: width*0.35),
|
||||||
|
width: width,
|
||||||
|
child: Card(
|
||||||
|
elevation: 10,
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.only(bottom: 20),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: width*0.30,
|
||||||
|
padding: EdgeInsets.all(10),
|
||||||
|
color: Colors.black54,
|
||||||
|
child: TextCustom(
|
||||||
|
text: 'Novo responsável',
|
||||||
|
color: Colors.white,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 15.0),
|
||||||
|
child: TextCustom(text: 'Prencha os campos todos os campos para adicionar.'),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: width>900? width * 0.18:width*0.4,
|
||||||
|
child: InputText(
|
||||||
|
inputFormatters: [],
|
||||||
|
controller: inputNome,
|
||||||
|
title: 'Nome Completo',
|
||||||
|
width: width * 0.18,
|
||||||
|
colorBorder: PaletteColors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: width>900? width * 0.18:width*0.4,
|
||||||
|
child: InputText(
|
||||||
|
inputFormatters: [],
|
||||||
|
controller: inputParentesco,
|
||||||
|
title: 'Parentesco',
|
||||||
|
width: width * 0.18,
|
||||||
|
colorBorder: PaletteColors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: width>900? width * 0.18:width*0.4,
|
||||||
|
child: InputText(
|
||||||
|
controller: inputCpf,
|
||||||
|
title: 'CPF',
|
||||||
|
width: width * 0.18,
|
||||||
|
colorBorder: PaletteColors.white,
|
||||||
|
inputFormatters: [
|
||||||
|
FilteringTextInputFormatter.digitsOnly,
|
||||||
|
CpfInputFormatter(),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: width>900? width * 0.18:width*0.4,
|
||||||
|
child: InputText(
|
||||||
|
inputFormatters: [],
|
||||||
|
controller: inputSenha,
|
||||||
|
title: 'Senha',
|
||||||
|
width: width * 0.18,
|
||||||
|
colorBorder: PaletteColors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
editando?Container(
|
||||||
|
width: width>900? width * 0.18:width*0.4,
|
||||||
|
child: InputText(
|
||||||
|
inputFormatters: [],
|
||||||
|
controller: inputData,
|
||||||
|
title: 'Data de Cadastro',
|
||||||
|
width: width * 0.18,
|
||||||
|
colorBorder: PaletteColors.white,
|
||||||
|
enable: false,
|
||||||
|
),
|
||||||
|
):Container(),
|
||||||
|
SizedBox(height: 50,),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
ButtonCustom(
|
||||||
|
onPressed:()=>setState((){
|
||||||
|
showRegister = false;
|
||||||
|
editando = false;
|
||||||
|
indice = null;
|
||||||
|
inputData.clear();
|
||||||
|
inputNome.clear();
|
||||||
|
inputParentesco.clear();
|
||||||
|
inputSenha.clear();
|
||||||
|
inputCpf.clear();
|
||||||
|
}),
|
||||||
|
text: 'Cancelar',
|
||||||
|
widthCustom: 0.1,
|
||||||
|
heightCustom: 0.05,
|
||||||
|
colorText: Colors.white,
|
||||||
|
colorBorder: PaletteColors.primaryColor,
|
||||||
|
colorButton: PaletteColors.primaryColor,
|
||||||
|
size: 15,
|
||||||
|
),
|
||||||
|
SizedBox(width: 50,),
|
||||||
|
ButtonCustom(
|
||||||
|
onPressed:()=>salvarResponsavel(),
|
||||||
|
text: 'Salvar',
|
||||||
|
widthCustom: 0.1,
|
||||||
|
heightCustom: 0.05,
|
||||||
|
colorText: Colors.white,
|
||||||
|
colorBorder: PaletteColors.green,
|
||||||
|
colorButton: PaletteColors.green,
|
||||||
|
size: 15,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
):Container(),
|
||||||
|
showRegister?Container():Container(
|
||||||
|
width: width*0.3,
|
||||||
|
height: height*0.3,
|
||||||
|
child: ListView.separated(
|
||||||
|
itemCount: responsaveis.length,
|
||||||
|
separatorBuilder: (context,index){
|
||||||
|
return Divider();
|
||||||
|
},
|
||||||
|
itemBuilder: (context,index){
|
||||||
|
return DadosResponsaveisContainer(
|
||||||
|
responsavelModel: responsaveis[index],
|
||||||
|
onTapEdit: (){
|
||||||
|
showRegister = true;
|
||||||
|
editando = true;
|
||||||
|
indice = index;
|
||||||
|
inputNome.text = responsaveis[index].nomeResponsavel;
|
||||||
|
inputParentesco.text = responsaveis[index].parentesco;
|
||||||
|
inputCpf.text = responsaveis[index].cpf;
|
||||||
|
inputSenha.text = responsaveis[index].senha;
|
||||||
|
inputData.text = responsaveis[index].dataCadastro;
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
onTapDelete: (){
|
||||||
|
responsaveis.removeAt(index);
|
||||||
|
setState(() {});
|
||||||
|
showSnackBar(context, 'Responsável deletado!', Colors.green);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -10,5 +10,5 @@ class PaletteColors{
|
|||||||
static const Color lightGrey = Color(0xffD0D0D0);
|
static const Color lightGrey = Color(0xffD0D0D0);
|
||||||
static const Color midGrey = Color(0xffC4C4C4);
|
static const Color midGrey = Color(0xffC4C4C4);
|
||||||
static const Color backGrey = Color(0xffE9E9E9);
|
static const Color backGrey = Color(0xffE9E9E9);
|
||||||
static const Color greenAcent = Color(0xff1DBF24);
|
static const Color green = Color(0xff06790c);
|
||||||
}
|
}
|
||||||
@@ -9,11 +9,8 @@ class ButtonCustom extends StatelessWidget{
|
|||||||
final Color colorBorder;
|
final Color colorBorder;
|
||||||
final widthCustom;
|
final widthCustom;
|
||||||
final heightCustom;
|
final heightCustom;
|
||||||
final font;
|
|
||||||
|
|
||||||
const ButtonCustom(
|
ButtonCustom({
|
||||||
{Key? key,
|
|
||||||
required this.font,
|
|
||||||
required this.onPressed,
|
required this.onPressed,
|
||||||
required this.text,
|
required this.text,
|
||||||
required this.size,
|
required this.size,
|
||||||
@@ -22,7 +19,7 @@ class ButtonCustom extends StatelessWidget{
|
|||||||
required this.colorBorder,
|
required this.colorBorder,
|
||||||
this.widthCustom = 1.0,
|
this.widthCustom = 1.0,
|
||||||
this.heightCustom = 1.0
|
this.heightCustom = 1.0
|
||||||
}) : super(key: key);
|
});
|
||||||
@override
|
@override
|
||||||
Widget build (BuildContext context) {
|
Widget build (BuildContext context) {
|
||||||
double width =MediaQuery.of(context).size.width;
|
double width =MediaQuery.of(context).size.width;
|
||||||
@@ -33,16 +30,14 @@ class ButtonCustom extends StatelessWidget{
|
|||||||
primary: colorButton,
|
primary: colorButton,
|
||||||
minimumSize: Size(width*widthCustom! , height*heightCustom!),
|
minimumSize: Size(width*widthCustom! , height*heightCustom!),
|
||||||
side: BorderSide(width: 2,color : colorBorder,),
|
side: BorderSide(width: 2,color : colorBorder,),
|
||||||
|
|
||||||
|
|
||||||
),
|
),
|
||||||
onPressed: onPressed,
|
onPressed: onPressed,
|
||||||
child: Text(text,
|
child: Text(text,
|
||||||
style: TextStyle(fontFamily: font, color: colorText,
|
style: TextStyle(
|
||||||
fontSize: size,fontWeight: FontWeight.bold
|
color: colorText,
|
||||||
|
fontSize: size,
|
||||||
|
fontWeight: FontWeight.bold
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|
||||||
) ,
|
) ,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import 'package:educa_controle_acesso/models/aluno_model.dart';
|
import 'package:educa_controle_acesso/models/aluno_model.dart';
|
||||||
|
import 'package:educa_controle_acesso/screens/responsible_register_screen.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 '../utils/colors.dart';
|
import '../utils/colors.dart';
|
||||||
@@ -13,37 +14,45 @@ class DadosAlunosContainer extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return InkWell(
|
||||||
padding: EdgeInsets.symmetric(vertical: 10,horizontal: 5),
|
onTap: (){
|
||||||
child: Column(
|
Navigator.push(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
context,
|
||||||
children: [
|
MaterialPageRoute(builder: (context) => ResponsibleRegisterScreen(alunoModel: alunoModel)),
|
||||||
TextCustom(
|
);
|
||||||
text: 'Nome: '+alunoModel.nome,
|
},
|
||||||
color: PaletteColors.grey,
|
child: Container(
|
||||||
size: 20,
|
padding: EdgeInsets.symmetric(vertical: 10,horizontal: 5),
|
||||||
),
|
child: Column(
|
||||||
TextCustom(
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
text: 'Data de Nascimento: '+alunoModel.data_nasc,
|
children: [
|
||||||
|
TextCustom(
|
||||||
|
text: 'Nome: '+alunoModel.nome,
|
||||||
|
color: PaletteColors.grey,
|
||||||
|
size: 20,
|
||||||
|
),
|
||||||
|
TextCustom(
|
||||||
|
text: 'Data de Nascimento: '+alunoModel.data_nasc,
|
||||||
|
color: PaletteColors.grey,
|
||||||
|
size: 15,
|
||||||
|
),
|
||||||
|
TextCustom(
|
||||||
|
text: 'RA: '+alunoModel.ra,
|
||||||
color: PaletteColors.grey,
|
color: PaletteColors.grey,
|
||||||
size: 15,
|
size: 15,
|
||||||
),
|
),
|
||||||
TextCustom(
|
TextCustom(
|
||||||
text: 'RA: '+alunoModel.ra,
|
text: 'Turma: '+alunoModel.serie+'° ANO '+alunoModel.turma,
|
||||||
color: PaletteColors.grey,
|
color: PaletteColors.grey,
|
||||||
size: 15,
|
size: 15,
|
||||||
),
|
),
|
||||||
TextCustom(
|
TextCustom(
|
||||||
text: 'Turma: '+alunoModel.serie+'° ANO '+alunoModel.turma,
|
text: 'Escola: '+alunoModel.escola,
|
||||||
color: PaletteColors.grey,
|
color: PaletteColors.grey,
|
||||||
size: 15,
|
size: 15,
|
||||||
),
|
),
|
||||||
TextCustom(
|
],
|
||||||
text: 'Escola: '+alunoModel.escola,
|
),
|
||||||
color: PaletteColors.grey,
|
|
||||||
size: 15,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
46
lib/widgets/dados_responsaveis_container.dart
Normal file
46
lib/widgets/dados_responsaveis_container.dart
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
import 'package:educa_controle_acesso/models/aluno_model.dart';
|
||||||
|
import 'package:educa_controle_acesso/models/responsavel_model.dart';
|
||||||
|
import 'package:educa_controle_acesso/screens/responsible_register_screen.dart';
|
||||||
|
import 'package:educa_controle_acesso/widgets/text_custom.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import '../utils/colors.dart';
|
||||||
|
|
||||||
|
class DadosResponsaveisContainer extends StatelessWidget {
|
||||||
|
|
||||||
|
ResponsavelModel responsavelModel;
|
||||||
|
var onTapEdit;
|
||||||
|
var onTapDelete;
|
||||||
|
|
||||||
|
DadosResponsaveisContainer({
|
||||||
|
required this.responsavelModel,
|
||||||
|
required this.onTapEdit,
|
||||||
|
required this.onTapDelete
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
|
||||||
|
double width = MediaQuery.of(context).size.width;
|
||||||
|
|
||||||
|
return InkWell(
|
||||||
|
onTap: onTapEdit,
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
IconButton(
|
||||||
|
onPressed:onTapDelete,
|
||||||
|
icon: Icon(Icons.delete,color: PaletteColors.grey,),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: width*0.15,
|
||||||
|
padding: EdgeInsets.symmetric(vertical: 10,horizontal: 5),
|
||||||
|
child: TextCustom(
|
||||||
|
text: '${responsavelModel.nomeResponsavel}, ${responsavelModel.parentesco}',
|
||||||
|
color: PaletteColors.grey,
|
||||||
|
size: 15,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -12,6 +12,8 @@ class InputText extends StatelessWidget {
|
|||||||
int maxLines;
|
int maxLines;
|
||||||
Color colorBorder;
|
Color colorBorder;
|
||||||
var onChanged;
|
var onChanged;
|
||||||
|
bool enable;
|
||||||
|
List<TextInputFormatter> inputFormatters;
|
||||||
|
|
||||||
InputText({
|
InputText({
|
||||||
required this.controller,
|
required this.controller,
|
||||||
@@ -23,6 +25,8 @@ class InputText extends StatelessWidget {
|
|||||||
this.maxLines = 1,
|
this.maxLines = 1,
|
||||||
this.colorBorder = PaletteColors.grey,
|
this.colorBorder = PaletteColors.grey,
|
||||||
this.onChanged = null,
|
this.onChanged = null,
|
||||||
|
this.enable = true,
|
||||||
|
required this.inputFormatters
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -32,11 +36,13 @@ class InputText extends StatelessWidget {
|
|||||||
width: width,
|
width: width,
|
||||||
margin: EdgeInsets.only(bottom: 5),
|
margin: EdgeInsets.only(bottom: 5),
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
|
inputFormatters: inputFormatters,
|
||||||
keyboardType: textInputType,
|
keyboardType: textInputType,
|
||||||
maxLines: maxLines,
|
maxLines: maxLines,
|
||||||
onChanged: onChanged,
|
onChanged: onChanged,
|
||||||
obscureText: this.obscure,
|
obscureText: this.obscure,
|
||||||
controller: this.controller,
|
controller: this.controller,
|
||||||
|
enabled: enable,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
fontSize: this.fontSize,
|
fontSize: this.fontSize,
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class TextCustom extends StatelessWidget {
|
|||||||
TextCustom({
|
TextCustom({
|
||||||
required this.text,
|
required this.text,
|
||||||
this.size = 16.0,
|
this.size = 16.0,
|
||||||
this.color = PaletteColors.primaryColor,
|
this.color = PaletteColors.grey,
|
||||||
this.fontWeight = FontWeight.normal,
|
this.fontWeight = FontWeight.normal,
|
||||||
this.textAlign = TextAlign.start,
|
this.textAlign = TextAlign.start,
|
||||||
this.maxLines = 1,
|
this.maxLines = 1,
|
||||||
|
|||||||
21
pubspec.lock
21
pubspec.lock
@@ -15,6 +15,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.0"
|
version: "2.1.0"
|
||||||
|
brasil_fields:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: brasil_fields
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "1.12.0"
|
||||||
characters:
|
characters:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -67,6 +74,20 @@ packages:
|
|||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
|
get:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: get
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "4.6.5"
|
||||||
|
intl:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: intl
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "0.18.1"
|
||||||
lints:
|
lints:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
@@ -11,6 +11,9 @@ dependencies:
|
|||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
|
||||||
cupertino_icons: ^1.0.2
|
cupertino_icons: ^1.0.2
|
||||||
|
brasil_fields:
|
||||||
|
get:
|
||||||
|
intl:
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
|||||||
Reference in New Issue
Block a user