criada a tela perfil_screen.dart
This commit is contained in:
17
lib/models/aluno_model.dart
Normal file
17
lib/models/aluno_model.dart
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
class AlunoModel{
|
||||||
|
String nome;
|
||||||
|
String foto;
|
||||||
|
String ra;
|
||||||
|
String escola;
|
||||||
|
int idade;
|
||||||
|
int anoEscolar;
|
||||||
|
|
||||||
|
AlunoModel({
|
||||||
|
required this.nome,
|
||||||
|
required this.foto,
|
||||||
|
required this.ra,
|
||||||
|
required this.escola,
|
||||||
|
required this.idade,
|
||||||
|
required this.anoEscolar,
|
||||||
|
});
|
||||||
|
}
|
||||||
72
lib/screens/perfil_screen.dart
Normal file
72
lib/screens/perfil_screen.dart
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:rkm_educa_app/models/aluno_model.dart';
|
||||||
|
import 'package:rkm_educa_app/utils/colors.dart';
|
||||||
|
import 'package:rkm_educa_app/widgets/alert_default.dart';
|
||||||
|
import 'package:rkm_educa_app/widgets/appbar_custom.dart';
|
||||||
|
import 'package:rkm_educa_app/widgets/drawer_custom.dart';
|
||||||
|
import 'package:rkm_educa_app/widgets/text_custom.dart';
|
||||||
|
|
||||||
|
import '../widgets/item_perfil.dart';
|
||||||
|
|
||||||
|
class PerfilScreen extends StatefulWidget {
|
||||||
|
AlunoModel alunoModel;
|
||||||
|
|
||||||
|
PerfilScreen({
|
||||||
|
required this.alunoModel
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<PerfilScreen> createState() => _PerfilScreenState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _PerfilScreenState extends State<PerfilScreen> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
appBar: AppBarCustom().appbar(context, 'PERFIL'),
|
||||||
|
drawer: DrawerCustom(alunoModel: widget.alunoModel),
|
||||||
|
body: ListView(
|
||||||
|
padding: EdgeInsets.symmetric(vertical: 50,horizontal: 20),
|
||||||
|
children: [
|
||||||
|
CircleAvatar(
|
||||||
|
radius: 70,
|
||||||
|
child: ClipRRect(
|
||||||
|
borderRadius:BorderRadius.circular(70),
|
||||||
|
child: Image.asset(widget.alunoModel.foto),
|
||||||
|
)
|
||||||
|
),
|
||||||
|
SizedBox(height: 25,),
|
||||||
|
ItemPerfil(texto: widget.alunoModel.nome,titulo: 'Nome',),
|
||||||
|
ItemPerfil(texto: widget.alunoModel.idade.toString()+' anos',titulo: 'Idade',),
|
||||||
|
ItemPerfil(texto: widget.alunoModel.anoEscolar.toString(),titulo: 'Ano Escolar',),
|
||||||
|
ItemPerfil(texto: widget.alunoModel.ra,titulo: 'RA',),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
ItemPerfil(texto: widget.alunoModel.escola,titulo: 'Escola',),
|
||||||
|
IconButton(
|
||||||
|
onPressed: ()=>
|
||||||
|
AlertDefault().alert(
|
||||||
|
context,
|
||||||
|
'',
|
||||||
|
'Fechar',
|
||||||
|
Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
ItemPerfil(texto: 'José Oliveira', titulo: 'Diretor(a)'),
|
||||||
|
ItemPerfil(texto: 'Luiz Araújo', titulo: 'Coordenador(a)'),
|
||||||
|
ItemPerfil(texto: '', titulo: 'Tefelones:'),
|
||||||
|
ItemPerfil(texto: 'Coordenação - (15) 3275 - 1234', titulo: ''),
|
||||||
|
ItemPerfil(texto: 'Secretaroa - (15) 3275 - 1234', titulo: ''),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
icon: Icon(Icons.visibility,color: PaletteColors.grey),
|
||||||
|
padding: EdgeInsets.all(0),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,14 +1,10 @@
|
|||||||
import 'dart:convert';
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:rkm_educa_app/models/aluno_model.dart';
|
||||||
import 'package:rkm_educa_app/screens/situacao_escolar_screen.dart';
|
import 'package:rkm_educa_app/screens/situacao_escolar_screen.dart';
|
||||||
import 'package:rkm_educa_app/widgets/appbar_custom.dart';
|
import 'package:rkm_educa_app/widgets/appbar_custom.dart';
|
||||||
import '../controllers/main_controllers.dart';
|
|
||||||
import '../utils/colors.dart';
|
import '../utils/colors.dart';
|
||||||
import '../widgets/buttom_custom.dart';
|
import '../widgets/buttom_custom.dart';
|
||||||
import '../widgets/input_text.dart';
|
|
||||||
import '../widgets/snackBars.dart';
|
import '../widgets/snackBars.dart';
|
||||||
import 'package:http/http.dart' as http;
|
|
||||||
|
|
||||||
import '../widgets/text_custom.dart';
|
import '../widgets/text_custom.dart';
|
||||||
|
|
||||||
@@ -21,10 +17,10 @@ class SelecionaFilhoScreen extends StatefulWidget {
|
|||||||
|
|
||||||
class _SelecionaFilhoScreenState extends State<SelecionaFilhoScreen> {
|
class _SelecionaFilhoScreenState extends State<SelecionaFilhoScreen> {
|
||||||
|
|
||||||
String? select;
|
AlunoModel? alunoModel;
|
||||||
List<String> alunos = [
|
List<AlunoModel> alunos = [
|
||||||
"Maria da Silva",
|
AlunoModel(nome: "Maria da Silva", foto: "assets/images/aluna.jpeg", ra: '000.000.000-08', escola: 'EMEI Profª Therezinha de Jesus Alguz', idade: 14, anoEscolar: 2023),
|
||||||
"João da Silva"
|
AlunoModel(nome: "João da Silva", foto: "assets/images/aluno.jpeg", ra: '000.000.000-10', escola: 'EMEI Profª Ernestina Loureiro Miranda', idade: 12, anoEscolar: 2023),
|
||||||
];
|
];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -63,13 +59,13 @@ class _SelecionaFilhoScreenState extends State<SelecionaFilhoScreen> {
|
|||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: TextCustom(text: 'Selecione'),
|
child: TextCustom(text: 'Selecione'),
|
||||||
),
|
),
|
||||||
value: select,
|
value: alunoModel,
|
||||||
items: alunos.map((value) => DropdownMenuItem(
|
items: alunos.map((value) => DropdownMenuItem(
|
||||||
value: value,
|
value: value,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: TextCustom(
|
child: TextCustom(
|
||||||
text: value,
|
text: value.nome,
|
||||||
color: Colors.black54,
|
color: Colors.black54,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -77,7 +73,7 @@ class _SelecionaFilhoScreenState extends State<SelecionaFilhoScreen> {
|
|||||||
).toList(),
|
).toList(),
|
||||||
onChanged: (value){
|
onChanged: (value){
|
||||||
setState(() {
|
setState(() {
|
||||||
select = value!;
|
alunoModel = value!;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -95,10 +91,10 @@ class _SelecionaFilhoScreenState extends State<SelecionaFilhoScreen> {
|
|||||||
colorButton: PaletteColors.primaryColor,
|
colorButton: PaletteColors.primaryColor,
|
||||||
colorBorder: PaletteColors.primaryColor,
|
colorBorder: PaletteColors.primaryColor,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
if(select!=null){
|
if(alunoModel!=null){
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
context,
|
context,
|
||||||
MaterialPageRoute(builder: (context) => SituacaoEscolarScreen()),
|
MaterialPageRoute(builder: (context) => SituacaoEscolarScreen(alunoModel: alunoModel!,)),
|
||||||
);
|
);
|
||||||
}else{
|
}else{
|
||||||
showSnackBar(context, 'Selecione um estudante para avançar', Colors.red);
|
showSnackBar(context, 'Selecione um estudante para avançar', Colors.red);
|
||||||
|
|||||||
@@ -1,11 +1,15 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:rkm_educa_app/models/aluno_model.dart';
|
||||||
import 'package:rkm_educa_app/utils/colors.dart';
|
import 'package:rkm_educa_app/utils/colors.dart';
|
||||||
import 'package:rkm_educa_app/widgets/text_custom.dart';
|
import 'package:rkm_educa_app/widgets/text_custom.dart';
|
||||||
|
|
||||||
import '../widgets/drawer_custom.dart';
|
import '../widgets/drawer_custom.dart';
|
||||||
|
|
||||||
class SituacaoEscolarScreen extends StatefulWidget {
|
class SituacaoEscolarScreen extends StatefulWidget {
|
||||||
const SituacaoEscolarScreen({Key? key}) : super(key: key);
|
AlunoModel alunoModel;
|
||||||
|
|
||||||
|
SituacaoEscolarScreen({
|
||||||
|
required this.alunoModel
|
||||||
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<SituacaoEscolarScreen> createState() => _SituacaoEscolarScreenState();
|
State<SituacaoEscolarScreen> createState() => _SituacaoEscolarScreenState();
|
||||||
@@ -30,7 +34,7 @@ class _SituacaoEscolarScreenState extends State<SituacaoEscolarScreen> {
|
|||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
drawer: DrawerCustom(),
|
drawer: DrawerCustom(alunoModel: widget.alunoModel),
|
||||||
body: ListView(
|
body: ListView(
|
||||||
children: [
|
children: [
|
||||||
Center(
|
Center(
|
||||||
|
|||||||
40
lib/widgets/alert_default.dart
Normal file
40
lib/widgets/alert_default.dart
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:rkm_educa_app/utils/colors.dart';
|
||||||
|
import 'package:rkm_educa_app/widgets/buttom_custom.dart';
|
||||||
|
import 'package:rkm_educa_app/widgets/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: PaletteColors.grey,
|
||||||
|
colorButton: PaletteColors.grey,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
actionsAlignment: MainAxisAlignment.center,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,13 +1,17 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:line_icons/line_icons.dart';
|
import 'package:line_icons/line_icons.dart';
|
||||||
|
import 'package:rkm_educa_app/models/aluno_model.dart';
|
||||||
import 'package:rkm_educa_app/screens/login_screen.dart';
|
import 'package:rkm_educa_app/screens/login_screen.dart';
|
||||||
|
import 'package:rkm_educa_app/screens/perfil_screen.dart';
|
||||||
import 'package:rkm_educa_app/utils/colors.dart';
|
import 'package:rkm_educa_app/utils/colors.dart';
|
||||||
import 'package:rkm_educa_app/widgets/text_custom.dart';
|
import 'package:rkm_educa_app/widgets/text_custom.dart';
|
||||||
|
|
||||||
import 'item_drawer.dart';
|
import 'item_drawer.dart';
|
||||||
|
|
||||||
class DrawerCustom extends StatelessWidget {
|
class DrawerCustom extends StatelessWidget {
|
||||||
const DrawerCustom({Key? key}) : super(key: key);
|
AlunoModel alunoModel;
|
||||||
|
DrawerCustom({
|
||||||
|
required this.alunoModel
|
||||||
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -23,32 +27,67 @@ class DrawerCustom extends StatelessWidget {
|
|||||||
radius: 70,
|
radius: 70,
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius:BorderRadius.circular(70),
|
borderRadius:BorderRadius.circular(70),
|
||||||
child: Image.asset("assets/images/aluna.jpeg"),
|
child: Image.asset(alunoModel.foto),
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: TextCustom(text: 'Maria da Silva',fontWeight: FontWeight.bold,size: 16.0,textAlign: TextAlign.center),
|
child: TextCustom(text: alunoModel.nome,fontWeight: FontWeight.bold,size: 16.0,textAlign: TextAlign.center),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
height: height*0.5,
|
height: height*0.5,
|
||||||
child: ListView(
|
child: ListView(
|
||||||
children: [
|
children: [
|
||||||
ItemDrawer(icone: LineIcons.userCircle,texto: 'Perfil',),
|
ItemDrawer(
|
||||||
|
icone: LineIcons.userCircle,
|
||||||
|
texto: 'Perfil',
|
||||||
|
onPressed: ()=> Navigator.pushReplacement(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(builder: (context) => PerfilScreen(alunoModel: alunoModel,)),
|
||||||
|
),
|
||||||
|
),
|
||||||
Container(height: 1,color: PaletteColors.divider,margin: EdgeInsets.symmetric(horizontal: 20),),
|
Container(height: 1,color: PaletteColors.divider,margin: EdgeInsets.symmetric(horizontal: 20),),
|
||||||
ItemDrawer(icone: LineIcons.clipboardList,texto: 'Boletim Escolar',),
|
ItemDrawer(
|
||||||
|
icone: LineIcons.clipboardList,
|
||||||
|
texto: 'Boletim Escolar',
|
||||||
|
onPressed: (){},
|
||||||
|
),
|
||||||
Container(height: 1,color: PaletteColors.divider,margin: EdgeInsets.symmetric(horizontal: 20),),
|
Container(height: 1,color: PaletteColors.divider,margin: EdgeInsets.symmetric(horizontal: 20),),
|
||||||
ItemDrawer(icone: LineIcons.fileContract,texto: 'Histórico Escolar',),
|
ItemDrawer(
|
||||||
|
icone: LineIcons.fileContract,
|
||||||
|
texto: 'Histórico Escolar',
|
||||||
|
onPressed: (){},
|
||||||
|
),
|
||||||
Container(height: 1,color: PaletteColors.divider,margin: EdgeInsets.symmetric(horizontal: 20),),
|
Container(height: 1,color: PaletteColors.divider,margin: EdgeInsets.symmetric(horizontal: 20),),
|
||||||
ItemDrawer(icone: LineIcons.checkSquareAlt,texto: 'Chamadas / Presenças',),
|
ItemDrawer(
|
||||||
|
icone: LineIcons.checkSquareAlt,
|
||||||
|
texto: 'Chamadas / Presenças',
|
||||||
|
onPressed: (){},
|
||||||
|
),
|
||||||
Container(height: 1,color: PaletteColors.divider,margin: EdgeInsets.symmetric(horizontal: 20),),
|
Container(height: 1,color: PaletteColors.divider,margin: EdgeInsets.symmetric(horizontal: 20),),
|
||||||
ItemDrawer(icone: LineIcons.calendarAlt,texto: 'Agenda Escolar',),
|
ItemDrawer(
|
||||||
|
icone: LineIcons.calendarAlt,
|
||||||
|
texto: 'Agenda Escolar',
|
||||||
|
onPressed: (){},
|
||||||
|
),
|
||||||
Container(height: 1,color: PaletteColors.divider,margin: EdgeInsets.symmetric(horizontal: 20),),
|
Container(height: 1,color: PaletteColors.divider,margin: EdgeInsets.symmetric(horizontal: 20),),
|
||||||
ItemDrawer(icone: LineIcons.calendarTimes,texto: 'Eventos Escolares',),
|
ItemDrawer(
|
||||||
|
icone: LineIcons.calendarTimes,
|
||||||
|
texto: 'Eventos Escolares',
|
||||||
|
onPressed: (){},
|
||||||
|
),
|
||||||
Container(height: 1,color: PaletteColors.divider,margin: EdgeInsets.symmetric(horizontal: 20),),
|
Container(height: 1,color: PaletteColors.divider,margin: EdgeInsets.symmetric(horizontal: 20),),
|
||||||
ItemDrawer(icone: LineIcons.mobilePhone,texto: 'Contatos',),
|
ItemDrawer(
|
||||||
|
icone: LineIcons.mobilePhone,
|
||||||
|
texto: 'Contatos',
|
||||||
|
onPressed: (){},
|
||||||
|
),
|
||||||
Container(height: 1,color: PaletteColors.divider,margin: EdgeInsets.symmetric(horizontal: 20),),
|
Container(height: 1,color: PaletteColors.divider,margin: EdgeInsets.symmetric(horizontal: 20),),
|
||||||
ItemDrawer(icone: LineIcons.bus,texto: 'Passe',),
|
ItemDrawer(
|
||||||
|
icone: LineIcons.bus,
|
||||||
|
texto: 'Passe',
|
||||||
|
onPressed: (){},
|
||||||
|
),
|
||||||
Container(height: 1,color: PaletteColors.divider,margin: EdgeInsets.symmetric(horizontal: 20),),
|
Container(height: 1,color: PaletteColors.divider,margin: EdgeInsets.symmetric(horizontal: 20),),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -6,10 +6,12 @@ import '../utils/colors.dart';
|
|||||||
class ItemDrawer extends StatelessWidget {
|
class ItemDrawer extends StatelessWidget {
|
||||||
IconData icone;
|
IconData icone;
|
||||||
String texto;
|
String texto;
|
||||||
|
var onPressed;
|
||||||
|
|
||||||
ItemDrawer({
|
ItemDrawer({
|
||||||
required this.texto,
|
required this.texto,
|
||||||
required this.icone
|
required this.icone,
|
||||||
|
required this.onPressed
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -19,7 +21,7 @@ class ItemDrawer extends StatelessWidget {
|
|||||||
padding: EdgeInsets.symmetric(horizontal: width*0.07),
|
padding: EdgeInsets.symmetric(horizontal: width*0.07),
|
||||||
alignment: Alignment.centerLeft,
|
alignment: Alignment.centerLeft,
|
||||||
child: TextButton.icon(
|
child: TextButton.icon(
|
||||||
onPressed: (){},
|
onPressed: onPressed,
|
||||||
icon: Icon(icone,color: PaletteColors.grey,),
|
icon: Icon(icone,color: PaletteColors.grey,),
|
||||||
label: TextCustom(text: texto,size: 16.0,)
|
label: TextCustom(text: texto,size: 16.0,)
|
||||||
),
|
),
|
||||||
|
|||||||
26
lib/widgets/item_perfil.dart
Normal file
26
lib/widgets/item_perfil.dart
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:rkm_educa_app/widgets/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: const EdgeInsets.symmetric(vertical: 10.0),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
TextCustom(text: titulo,size: 14.0,fontWeight: FontWeight.bold,),
|
||||||
|
SizedBox(width: 10,),
|
||||||
|
TextCustom(text: texto,size: 14.0),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user