ajustes de layout

This commit is contained in:
Reginaldo
2023-06-01 16:34:36 -03:00
parent 9e27ea48a4
commit c4fe38b215
8 changed files with 353 additions and 117 deletions

View File

@@ -0,0 +1,39 @@
import 'package:educa_controle_acesso/widgets/text_custom.dart';
import 'package:flutter/material.dart';
import '../utils/colors.dart';
class CaixaTextoContainer extends StatelessWidget {
String texto;
String titulo;
double widthCustom;
CaixaTextoContainer({
required this.texto,
required this.titulo,
this.widthCustom = 0.2
});
@override
Widget build(BuildContext context) {
double width = MediaQuery.of(context).size.width;
return Container(
margin: EdgeInsets.all(5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
TextCustom(text: titulo,size: 12,),
Container(
child: TextCustom(text: texto),
width: width*widthCustom,
padding: EdgeInsets.all(5),
decoration: BoxDecoration(
color: PaletteColors.greyInput,
borderRadius: BorderRadius.circular(3),
border: Border.all(color: PaletteColors.lightGrey)
),
),
],
),
);
}
}

View File

@@ -3,6 +3,7 @@ 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';
import 'caixa_texto_container.dart';
class DadosAlunosContainer extends StatelessWidget {
@@ -14,7 +15,11 @@ class DadosAlunosContainer extends StatelessWidget {
@override
Widget build(BuildContext context) {
double width = MediaQuery.of(context).size.width;
return InkWell(
hoverColor: PaletteColors.lightGrey,
onTap: (){
Navigator.push(
context,
@@ -22,34 +27,37 @@ class DadosAlunosContainer extends StatelessWidget {
);
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 10,horizontal: 5),
padding: EdgeInsets.symmetric(vertical: 10,horizontal: 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
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,
size: 15,
),
TextCustom(
text: 'Turma: '+alunoModel.serie+'° ANO '+alunoModel.turma,
color: PaletteColors.grey,
size: 15,
),
TextCustom(
text: 'Escola: '+alunoModel.escola,
color: PaletteColors.grey,
size: 15,
Row(
children: [
Container(
width: width*0.2,
child: TextCustom(text: alunoModel.nome.toUpperCase())
),
Container(
width: width*0.1,
child: TextCustom(text: alunoModel.data_nasc.toUpperCase())
),
Container(
width: width*0.08,
child: TextCustom(text: alunoModel.ra.toUpperCase())
),
Container(
width: width*0.05,
child: TextCustom(text: alunoModel.serie.toUpperCase()+'°')
),
Container(
width: width*0.05,
child: TextCustom(text: alunoModel.turma.toUpperCase())
),
Container(
width: width*0.20,
child: TextCustom(text: alunoModel.escola.toUpperCase())
),
],
),
],
),

View File

@@ -4,6 +4,7 @@ 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';
import 'caixa_texto_container.dart';
class DadosResponsaveisContainer extends StatelessWidget {
@@ -31,12 +32,13 @@ class DadosResponsaveisContainer extends StatelessWidget {
icon: Icon(Icons.delete,color: PaletteColors.grey,),
),
Container(
width: width*0.15,
width: width*0.35,
padding: EdgeInsets.symmetric(vertical: 10,horizontal: 5),
child: TextCustom(
text: '${responsavelModel.nomeResponsavel}, ${responsavelModel.parentesco}',
color: PaletteColors.grey,
size: 15,
child: Row(
children: [
CaixaTextoContainer(texto: responsavelModel.nomeResponsavel,titulo: 'Nome',widthCustom: 0.15),
CaixaTextoContainer(texto: responsavelModel.parentesco,titulo: 'Parentesco',widthCustom: 0.1,),
],
),
),
],

View File

@@ -1,4 +1,5 @@
import 'package:educa_controle_acesso/utils/colors.dart';
import 'package:educa_controle_acesso/widgets/text_custom.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
@@ -7,10 +8,12 @@ class InputText extends StatelessWidget {
var controller;
double fontSize;
String title;
String hint;
double width;
TextInputType textInputType;
int maxLines;
Color colorBorder;
Color colorBackground;
var onChanged;
bool enable;
List<TextInputFormatter> inputFormatters;
@@ -21,9 +24,11 @@ class InputText extends StatelessWidget {
this.obscure = false,
this.fontSize = 15.0,
this.title = '',
this.hint = '',
this.textInputType = TextInputType.text,
this.maxLines = 1,
this.colorBorder = PaletteColors.grey,
this.colorBackground = PaletteColors.greyInput,
this.onChanged = null,
this.enable = true,
required this.inputFormatters
@@ -31,47 +36,54 @@ class InputText extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
color:PaletteColors.greyInput,
width: width,
margin: EdgeInsets.only(bottom: 5),
child: TextFormField(
inputFormatters: inputFormatters,
keyboardType: textInputType,
maxLines: maxLines,
onChanged: onChanged,
obscureText: this.obscure,
controller: this.controller,
enabled: enable,
style: TextStyle(
color: Colors.black,
fontSize: this.fontSize,
fontFamily: 'Nunito'
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
TextCustom(text: title,size: 10),
Container(
color:colorBackground,
width: width,
margin: EdgeInsets.only(bottom: 5),
child: TextFormField(
inputFormatters: inputFormatters,
keyboardType: textInputType,
maxLines: maxLines,
onChanged: onChanged,
obscureText: this.obscure,
controller: this.controller,
enabled: enable,
style: TextStyle(
color: Colors.black,
fontSize: this.fontSize,
fontFamily: 'Nunito'
),
decoration: InputDecoration(
// fillColor: PaletteColors.primaryColor,
// labelText: title,
border: OutlineInputBorder(
borderSide: BorderSide(width: 1,color: colorBorder)
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(width: 1, color: colorBorder),
borderRadius: BorderRadius.circular(3),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(width: 1, color: colorBorder),
borderRadius: BorderRadius.circular(3),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(width: 1, color: colorBorder),
borderRadius: BorderRadius.circular(3),
),
hintText: hint,
hintStyle: TextStyle(
color: PaletteColors.grey,
fontSize: this.fontSize,
)
)
),
),
decoration: InputDecoration(
// fillColor: PaletteColors.primaryColor,
labelText: title,
border: OutlineInputBorder(
borderSide: BorderSide(width: 1,color: colorBorder)
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(width: 1, color: colorBorder),
borderRadius: BorderRadius.circular(3),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(width: 1, color: colorBorder),
borderRadius: BorderRadius.circular(3),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(width: 1, color: colorBorder),
borderRadius: BorderRadius.circular(3),
),
hintStyle: TextStyle(
color: Colors.black,
fontSize: this.fontSize,
)
)
),
],
);
}
}