criada as telas tela_avisos.dart, tela_detalhes_avisos.dart e tela_contatos.dart
This commit is contained in:
40
lib/componentes/alert_default.dart
Normal file
40
lib/componentes/alert_default.dart
Normal file
@@ -0,0 +1,40 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rkm_educa_app/utils/cores.dart';
|
||||
import 'package:rkm_educa_app/componentes/buttom_custom.dart';
|
||||
import 'package:rkm_educa_app/componentes/text_custom.dart';
|
||||
|
||||
class AlertDefault{
|
||||
alert(BuildContext context,String title,String textButtom,Widget subtitle,) {
|
||||
|
||||
double width = MediaQuery.of(context).size.width;
|
||||
double height = MediaQuery.of(context).size.height;
|
||||
|
||||
return showDialog(
|
||||
context: context,
|
||||
builder: (context){
|
||||
return AlertDialog(
|
||||
title: TextCustom(
|
||||
text: title,
|
||||
color: Colors.black54,
|
||||
textAlign: TextAlign.center,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
content: subtitle,
|
||||
actions: [
|
||||
ButtonCustom(
|
||||
onPressed: ()=>Navigator.pop(context),
|
||||
text: textButtom,
|
||||
widthCustom: 0.2,
|
||||
heightCustom: 0.05,
|
||||
size: 14,
|
||||
colorText: Colors.white,
|
||||
colorBorder: PaletaCores.cinza,
|
||||
colorButton: PaletaCores.cinza,
|
||||
)
|
||||
],
|
||||
actionsAlignment: MainAxisAlignment.center,
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
19
lib/componentes/appbar_custom.dart
Normal file
19
lib/componentes/appbar_custom.dart
Normal file
@@ -0,0 +1,19 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rkm_educa_app/componentes/text_custom.dart';
|
||||
|
||||
import '../utils/cores.dart';
|
||||
|
||||
class AppBarCustom{
|
||||
@override
|
||||
PreferredSize appbar(BuildContext context,String title) {
|
||||
|
||||
return PreferredSize(
|
||||
preferredSize: Size.fromHeight(50),
|
||||
child: AppBar(
|
||||
backgroundColor: PaletaCores.appBar,
|
||||
centerTitle: true,
|
||||
title: TextCustom(text: title,color: Colors.white,fontWeight: FontWeight.bold,size: 20.0,),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
44
lib/componentes/buttom_custom.dart
Normal file
44
lib/componentes/buttom_custom.dart
Normal file
@@ -0,0 +1,44 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rkm_educa_app/utils/dimensoes.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;
|
||||
|
||||
ButtonCustom({
|
||||
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
|
||||
});
|
||||
@override
|
||||
Widget build (BuildContext context) {
|
||||
|
||||
return ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
primary: colorButton,
|
||||
minimumSize: Size(Dimensoes.width*widthCustom! , Dimensoes.height*heightCustom!),
|
||||
side: BorderSide(width: 2,color : colorBorder,),
|
||||
),
|
||||
onPressed: onPressed,
|
||||
child: Text(text,
|
||||
style: TextStyle(
|
||||
color: colorText,
|
||||
fontSize: size,
|
||||
fontWeight: FontWeight.bold
|
||||
),
|
||||
) ,
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
124
lib/componentes/drawer_custom.dart
Normal file
124
lib/componentes/drawer_custom.dart
Normal file
@@ -0,0 +1,124 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:line_icons/line_icons.dart';
|
||||
import 'package:rkm_educa_app/Telas/tela_situacao_escolar.dart';
|
||||
import 'package:rkm_educa_app/modelos/estudante_modelo.dart';
|
||||
import 'package:rkm_educa_app/telas/tela_contatos.dart';
|
||||
import 'package:rkm_educa_app/telas/tela_login.dart';
|
||||
import 'package:rkm_educa_app/telas/tela_perfil.dart';
|
||||
import 'package:rkm_educa_app/utils/cores.dart';
|
||||
import 'package:rkm_educa_app/componentes/text_custom.dart';
|
||||
import 'package:rkm_educa_app/utils/dimensoes.dart';
|
||||
import 'item_drawer.dart';
|
||||
|
||||
class DrawerCustom extends StatelessWidget {
|
||||
EstudanteModelo estudanteModelo;
|
||||
DrawerCustom({
|
||||
required this.estudanteModelo
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
padding: EdgeInsets.symmetric(vertical: 20),
|
||||
width: Dimensoes.width*0.8,
|
||||
color: Colors.white,
|
||||
child: ListView(
|
||||
children: [
|
||||
CircleAvatar(
|
||||
radius: 70,
|
||||
child: ClipRRect(
|
||||
borderRadius:BorderRadius.circular(70),
|
||||
child: Image.asset(estudanteModelo.foto),
|
||||
)
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: TextCustom(text: estudanteModelo.nome,fontWeight: FontWeight.bold,size: 16.0,textAlign: TextAlign.center),
|
||||
),
|
||||
Container(
|
||||
height: Dimensoes.height*0.5,
|
||||
child: ListView(
|
||||
children: [
|
||||
ItemDrawer(
|
||||
icone: LineIcons.home,
|
||||
texto: 'Situação Escolar',
|
||||
onPressed: ()=> Navigator.pushReplacement(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) => TelaSituacaoEscolar(estudanteModelo: estudanteModelo,)),
|
||||
),
|
||||
),
|
||||
Container(height: 1,color: PaletaCores.divider,margin: EdgeInsets.symmetric(horizontal: 20),),
|
||||
ItemDrawer(
|
||||
icone: LineIcons.userCircle,
|
||||
texto: 'Perfil',
|
||||
onPressed: ()=> Navigator.pushReplacement(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) => TelaPerfil(estudanteModelo: estudanteModelo,)),
|
||||
),
|
||||
),
|
||||
Container(height: 1,color: PaletaCores.divider,margin: EdgeInsets.symmetric(horizontal: 20),),
|
||||
ItemDrawer(
|
||||
icone: LineIcons.clipboardList,
|
||||
texto: 'Boletim Escolar',
|
||||
onPressed: (){},
|
||||
),
|
||||
Container(height: 1,color: PaletaCores.divider,margin: EdgeInsets.symmetric(horizontal: 20),),
|
||||
ItemDrawer(
|
||||
icone: LineIcons.fileContract,
|
||||
texto: 'Histórico Escolar',
|
||||
onPressed: (){},
|
||||
),
|
||||
Container(height: 1,color: PaletaCores.divider,margin: EdgeInsets.symmetric(horizontal: 20),),
|
||||
ItemDrawer(
|
||||
icone: LineIcons.checkSquareAlt,
|
||||
texto: 'Chamadas / Presenças',
|
||||
onPressed: (){},
|
||||
),
|
||||
Container(height: 1,color: PaletaCores.divider,margin: EdgeInsets.symmetric(horizontal: 20),),
|
||||
ItemDrawer(
|
||||
icone: LineIcons.calendarAlt,
|
||||
texto: 'Agenda Escolar',
|
||||
onPressed: (){},
|
||||
),
|
||||
Container(height: 1,color: PaletaCores.divider,margin: EdgeInsets.symmetric(horizontal: 20),),
|
||||
ItemDrawer(
|
||||
icone: LineIcons.calendarTimes,
|
||||
texto: 'Eventos Escolares',
|
||||
onPressed: (){},
|
||||
),
|
||||
Container(height: 1,color: PaletaCores.divider,margin: EdgeInsets.symmetric(horizontal: 20),),
|
||||
ItemDrawer(
|
||||
icone: LineIcons.mobilePhone,
|
||||
texto: 'Contatos',
|
||||
onPressed: ()=>Navigator.push(context, MaterialPageRoute(builder: (context)=>TelaContatos(estudanteModelo: estudanteModelo,))),
|
||||
),
|
||||
Container(height: 1,color: PaletaCores.divider,margin: EdgeInsets.symmetric(horizontal: 20),),
|
||||
ItemDrawer(
|
||||
icone: LineIcons.bus,
|
||||
texto: 'Passe',
|
||||
onPressed: (){},
|
||||
),
|
||||
Container(height: 1,color: PaletaCores.divider,margin: EdgeInsets.symmetric(horizontal: 20),),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: Dimensoes.height*0.15,),
|
||||
SafeArea(
|
||||
child: Container(
|
||||
alignment: Alignment.bottomRight,
|
||||
child: IconButton(
|
||||
icon: Icon(LineIcons.alternateSignOut,size: 30),
|
||||
onPressed: (){
|
||||
Navigator.pushReplacement(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) => TelaLogin()),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
84
lib/componentes/input_text.dart
Normal file
84
lib/componentes/input_text.dart
Normal file
@@ -0,0 +1,84 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
import '../utils/cores.dart';
|
||||
|
||||
class InputText extends StatelessWidget {
|
||||
bool obscure;
|
||||
var controller;
|
||||
double fontSize;
|
||||
String title;
|
||||
double width;
|
||||
TextInputType textInputType;
|
||||
int maxLines;
|
||||
Color colorBorder;
|
||||
var onChanged;
|
||||
bool enable;
|
||||
List<TextInputFormatter> inputFormatters;
|
||||
|
||||
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 = PaletaCores.cinza,
|
||||
this.onChanged = null,
|
||||
this.enable = true,
|
||||
required this.inputFormatters
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
children: [
|
||||
Container(
|
||||
width: width,
|
||||
child: Text(title,style: TextStyle(fontWeight: FontWeight.bold,fontFamily: 'Nunito'),)
|
||||
),
|
||||
Container(
|
||||
color:PaletaCores.cinzaInput,
|
||||
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(
|
||||
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,
|
||||
)
|
||||
)
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
73
lib/componentes/item_avisos.dart
Normal file
73
lib/componentes/item_avisos.dart
Normal file
@@ -0,0 +1,73 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rkm_educa_app/componentes/text_custom.dart';
|
||||
import '../utils/cores.dart';
|
||||
|
||||
class ItemAvisos extends StatelessWidget {
|
||||
|
||||
String data;
|
||||
String aviso;
|
||||
bool naovisto;
|
||||
var onTap;
|
||||
|
||||
ItemAvisos({
|
||||
required this.data,
|
||||
required this.aviso,
|
||||
required this.naovisto,
|
||||
required this.onTap
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
double height = MediaQuery.of(context).size.height;
|
||||
double width = MediaQuery.of(context).size.width;
|
||||
|
||||
return GestureDetector(
|
||||
onTap: onTap,
|
||||
child: Container(
|
||||
color: PaletaCores.branco,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20.0,vertical: 5),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
width: width*0.8,
|
||||
height: 65,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 5),
|
||||
child: Row(
|
||||
children: [
|
||||
TextCustom(text: 'Data',size: 14.0,fontWeight: FontWeight.bold),
|
||||
SizedBox(width: 10,),
|
||||
TextCustom(text: data,size: 14.0,fontWeight: naovisto?FontWeight.bold:FontWeight.normal,color: naovisto?PaletaCores.cinzaEscuro:PaletaCores.cinzaClaro,),
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 5),
|
||||
child: Row(
|
||||
children: [
|
||||
TextCustom(text: 'Aviso',size: 14.0,fontWeight: FontWeight.bold),
|
||||
SizedBox(width: 10,),
|
||||
TextCustom(text: aviso,fontWeight: naovisto?FontWeight.bold:FontWeight.normal,color: naovisto?PaletaCores.cinzaEscuro:PaletaCores.cinzaClaro,),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
naovisto?CircleAvatar(backgroundColor: PaletaCores.notificacao,radius: 6,):Container()
|
||||
],
|
||||
),
|
||||
Container(width: double.infinity,height: 2,color: PaletaCores.divider,)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
29
lib/componentes/item_drawer.dart
Normal file
29
lib/componentes/item_drawer.dart
Normal file
@@ -0,0 +1,29 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rkm_educa_app/componentes/text_custom.dart';
|
||||
import '../utils/cores.dart';
|
||||
|
||||
class ItemDrawer extends StatelessWidget {
|
||||
IconData icone;
|
||||
String texto;
|
||||
var onPressed;
|
||||
|
||||
ItemDrawer({
|
||||
required this.texto,
|
||||
required this.icone,
|
||||
required this.onPressed
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
double width = MediaQuery.of(context).size.width;
|
||||
return Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: width*0.07),
|
||||
alignment: Alignment.centerLeft,
|
||||
child: TextButton.icon(
|
||||
onPressed: onPressed,
|
||||
icon: Icon(icone,color: PaletaCores.cinza,),
|
||||
label: TextCustom(text: texto,size: 16.0,)
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
26
lib/componentes/item_perfil.dart
Normal file
26
lib/componentes/item_perfil.dart
Normal file
@@ -0,0 +1,26 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rkm_educa_app/componentes/text_custom.dart';
|
||||
|
||||
class ItemPerfil extends StatelessWidget {
|
||||
String texto;
|
||||
String titulo;
|
||||
|
||||
ItemPerfil({
|
||||
required this.texto,
|
||||
required this.titulo,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 10),
|
||||
child: Row(
|
||||
children: [
|
||||
TextCustom(text: titulo,size: 14.0,fontWeight: FontWeight.bold,),
|
||||
SizedBox(width: 10,),
|
||||
TextCustom(text: texto,size: 14.0),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
20
lib/componentes/snackBars.dart
Normal file
20
lib/componentes/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);
|
||||
}
|
||||
42
lib/componentes/text_custom.dart
Normal file
42
lib/componentes/text_custom.dart
Normal file
@@ -0,0 +1,42 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../utils/cores.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 = PaletaCores.cinza,
|
||||
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,
|
||||
fontFamily: 'Nunito'
|
||||
),
|
||||
maxLines: maxLines,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user