novo projeto
This commit is contained in:
50
lib/widgets/buttom_custom.dart
Normal file
50
lib/widgets/buttom_custom.dart
Normal file
@@ -0,0 +1,50 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ButtonCustom extends StatelessWidget{
|
||||
final VoidCallback onPressed;
|
||||
final String text;
|
||||
final double size;
|
||||
final Color colorButton;
|
||||
final Color colorText;
|
||||
final Color colorBorder;
|
||||
final widthCustom;
|
||||
final heightCustom;
|
||||
final font;
|
||||
|
||||
const ButtonCustom(
|
||||
{Key? key,
|
||||
required this.font,
|
||||
required this.onPressed,
|
||||
required this.text,
|
||||
required this.size,
|
||||
required this.colorButton,
|
||||
required this.colorText,
|
||||
required this.colorBorder,
|
||||
this.widthCustom = 1.0,
|
||||
this.heightCustom = 1.0
|
||||
}) : super(key: key);
|
||||
@override
|
||||
Widget build (BuildContext context) {
|
||||
double width =MediaQuery.of(context).size.width;
|
||||
double height =MediaQuery.of(context).size.height;
|
||||
|
||||
return ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
primary: colorButton,
|
||||
minimumSize: Size(width*widthCustom! , height*heightCustom!),
|
||||
side: BorderSide(width: 2,color : colorBorder,),
|
||||
|
||||
|
||||
),
|
||||
onPressed: onPressed,
|
||||
child: Text(text,
|
||||
style: TextStyle(fontFamily: font, color: colorText,
|
||||
fontSize: size,fontWeight: FontWeight.bold
|
||||
),
|
||||
|
||||
|
||||
) ,
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
50
lib/widgets/dados_alunos_container.dart
Normal file
50
lib/widgets/dados_alunos_container.dart
Normal file
@@ -0,0 +1,50 @@
|
||||
import 'package:educa_controle_acesso/models/aluno_model.dart';
|
||||
import 'package:educa_controle_acesso/widgets/text_custom.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '../utils/colors.dart';
|
||||
|
||||
class DadosAlunosContainer extends StatelessWidget {
|
||||
|
||||
AlunoModel alunoModel;
|
||||
|
||||
DadosAlunosContainer({
|
||||
required this.alunoModel
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
padding: EdgeInsets.symmetric(vertical: 10,horizontal: 5),
|
||||
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,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
70
lib/widgets/input_text.dart
Normal file
70
lib/widgets/input_text.dart
Normal file
@@ -0,0 +1,70 @@
|
||||
import 'package:educa_controle_acesso/utils/colors.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
class InputText extends StatelessWidget {
|
||||
bool obscure;
|
||||
var controller;
|
||||
double fontSize;
|
||||
String title;
|
||||
double width;
|
||||
TextInputType textInputType;
|
||||
int maxLines;
|
||||
Color colorBorder;
|
||||
var onChanged;
|
||||
|
||||
InputText({
|
||||
required this.controller,
|
||||
required this.width,
|
||||
this.obscure = false,
|
||||
this.fontSize = 15.0,
|
||||
this.title = '',
|
||||
this.textInputType = TextInputType.text,
|
||||
this.maxLines = 1,
|
||||
this.colorBorder = PaletteColors.grey,
|
||||
this.onChanged = null,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
color:PaletteColors.greyInput,
|
||||
width: width,
|
||||
margin: EdgeInsets.only(bottom: 5),
|
||||
child: TextFormField(
|
||||
keyboardType: textInputType,
|
||||
maxLines: maxLines,
|
||||
onChanged: onChanged,
|
||||
obscureText: this.obscure,
|
||||
controller: this.controller,
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
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,
|
||||
)
|
||||
)
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
20
lib/widgets/snackBars.dart
Normal file
20
lib/widgets/snackBars.dart
Normal file
@@ -0,0 +1,20 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
void showSnackBar(BuildContext context, String text,Color colors){
|
||||
|
||||
final snackbar = SnackBar(
|
||||
backgroundColor: colors,
|
||||
content: Row(
|
||||
children: [
|
||||
Icon(Icons.info_outline,color: Colors.white),
|
||||
SizedBox(width: 20),
|
||||
Expanded(
|
||||
child: Text(text,
|
||||
style: TextStyle(fontSize: 16),),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
ScaffoldMessenger.of(context).showSnackBar(snackbar);
|
||||
}
|
||||
41
lib/widgets/text_custom.dart
Normal file
41
lib/widgets/text_custom.dart
Normal file
@@ -0,0 +1,41 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../utils/colors.dart';
|
||||
|
||||
class TextCustom extends StatelessWidget {
|
||||
final text;
|
||||
final size;
|
||||
final color;
|
||||
final fontWeight;
|
||||
final textAlign;
|
||||
final maxLines;
|
||||
final underscore;
|
||||
|
||||
TextCustom({
|
||||
required this.text,
|
||||
this.size = 16.0,
|
||||
this.color = PaletteColors.primaryColor,
|
||||
this.fontWeight = FontWeight.normal,
|
||||
this.textAlign = TextAlign.start,
|
||||
this.maxLines = 1,
|
||||
this.underscore,
|
||||
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Text(
|
||||
text,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
textAlign: textAlign,
|
||||
style: TextStyle(
|
||||
color: color,
|
||||
fontSize: size,
|
||||
fontWeight: fontWeight,
|
||||
decoration: underscore,
|
||||
decorationThickness: 4
|
||||
),
|
||||
maxLines: maxLines,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user