344 lines
12 KiB
Dart
344 lines
12 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:rkm_educa_app/modelos/estudante_modelo.dart';
|
|
import 'package:rkm_educa_app/telas/tela_avisos.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 'package:syncfusion_flutter_charts/charts.dart';
|
|
import '../componentes/drawer_custom.dart';
|
|
import 'dart:ui' as ui;
|
|
|
|
class TelaSituacaoEscolar extends StatefulWidget {
|
|
EstudanteModelo estudanteModelo;
|
|
|
|
TelaSituacaoEscolar({
|
|
required this.estudanteModelo
|
|
});
|
|
|
|
@override
|
|
State<TelaSituacaoEscolar> createState() => _TelaSituacaoEscolarState();
|
|
}
|
|
|
|
class _TelaSituacaoEscolarState extends State<TelaSituacaoEscolar> {
|
|
|
|
late List<_ChartData> data;
|
|
late TooltipBehavior _tooltip;
|
|
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
data = [
|
|
_ChartData('Faltas', 10,Color(0xffD9D9D9)),
|
|
_ChartData('Presenças', 90,Color(0xff43A65F)),
|
|
];
|
|
_tooltip = TooltipBehavior(enable: true);
|
|
}
|
|
|
|
Widget graph(BuildContext context) {
|
|
return SfCircularChart(
|
|
tooltipBehavior: _tooltip,
|
|
series: <CircularSeries<dynamic, dynamic>>[
|
|
DoughnutSeries<_ChartData, String>(
|
|
dataSource: data,
|
|
xValueMapper: (_ChartData data, _) => data.x,
|
|
yValueMapper: (_ChartData data, _) => data.y,
|
|
pointColorMapper: (_ChartData data, _) => data.color,
|
|
radius:'45'
|
|
)
|
|
]
|
|
);
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
backgroundColor: PaletaCores.fundoTela,
|
|
appBar: AppBar(
|
|
iconTheme: IconThemeData(color: PaletaCores.cinza),
|
|
backgroundColor: Colors.transparent,
|
|
elevation: 0,
|
|
actions: [
|
|
Padding(
|
|
padding: const EdgeInsets.all(4.0),
|
|
child: IconButton(
|
|
onPressed: ()=>Navigator.push(context, MaterialPageRoute(builder: (context)=>TelaAvisos(estudanteModelo: widget.estudanteModelo,))),
|
|
icon: Icon(Icons.notifications_outlined,size: 32),
|
|
)
|
|
)
|
|
],
|
|
),
|
|
drawer: DrawerCustom(estudanteModelo: widget.estudanteModelo),
|
|
body: ListView(
|
|
children: [
|
|
Center(
|
|
child: TextCustom(text: 'Situção Escolar',fontWeight: FontWeight.bold,size: 20.0,),
|
|
),
|
|
SizedBox(
|
|
height: Dimensoes.height*0.1,
|
|
),
|
|
Card(
|
|
margin: EdgeInsets.symmetric(horizontal: 30),
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(8.0),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
TextCustom(text: 'Últimas Notas',fontWeight: FontWeight.bold,),
|
|
Row(
|
|
children: [
|
|
Container(
|
|
width: Dimensoes.width*0.3,
|
|
child: TextCustom(text: 'Matemática',)
|
|
),
|
|
Container(
|
|
alignment: Alignment.center,
|
|
width: Dimensoes.width*0.1,
|
|
child: TextCustom(text: '10',)
|
|
),
|
|
],
|
|
),
|
|
Row(
|
|
children: [
|
|
Container(
|
|
width: Dimensoes.width*0.3,
|
|
child: TextCustom(text: 'Português',)
|
|
),
|
|
Container(
|
|
alignment: Alignment.center,
|
|
width: Dimensoes.width*0.1,
|
|
child: TextCustom(text: '9',)
|
|
),
|
|
],
|
|
),
|
|
Row(
|
|
children: [
|
|
Container(
|
|
width: Dimensoes.width*0.3,
|
|
child: TextCustom(text: 'História',)
|
|
),
|
|
Container(
|
|
alignment: Alignment.center,
|
|
width: Dimensoes.width*0.1,
|
|
child: TextCustom(text: '10',)
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
SizedBox(
|
|
height: Dimensoes.height*0.03,
|
|
),
|
|
Card(
|
|
margin: EdgeInsets.symmetric(horizontal: 30),
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(8.0),
|
|
child: Row(
|
|
children: [
|
|
Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
TextCustom(text: 'Faltas',fontWeight: FontWeight.bold,),
|
|
Row(
|
|
children: [
|
|
Container(
|
|
width: Dimensoes.width*0.3,
|
|
child: TextCustom(text: 'Matemática',)
|
|
),
|
|
Container(
|
|
alignment: Alignment.center,
|
|
width: Dimensoes.width*0.1,
|
|
child: TextCustom(text: '3',)
|
|
),
|
|
],
|
|
),
|
|
Row(
|
|
children: [
|
|
Container(
|
|
width: Dimensoes.width*0.3,
|
|
child: TextCustom(text: 'Português',)
|
|
),
|
|
Container(
|
|
alignment: Alignment.center,
|
|
width: Dimensoes.width*0.1,
|
|
child: TextCustom(text: '1',)
|
|
),
|
|
],
|
|
),
|
|
Row(
|
|
children: [
|
|
Container(
|
|
width: Dimensoes.width*0.3,
|
|
child: TextCustom(text: 'História',)
|
|
),
|
|
Container(
|
|
alignment: Alignment.center,
|
|
width: Dimensoes.width*0.1,
|
|
child: TextCustom(text: '5',)
|
|
),
|
|
],
|
|
),
|
|
Row(
|
|
children: [
|
|
Container(
|
|
width: Dimensoes.width*0.3,
|
|
child: TextCustom(text: 'Geografia',)
|
|
),
|
|
Container(
|
|
alignment: Alignment.center,
|
|
width: Dimensoes.width*0.1,
|
|
child: TextCustom(text: '2',)
|
|
),
|
|
],
|
|
),
|
|
Row(
|
|
children: [
|
|
Container(
|
|
width: Dimensoes.width*0.3,
|
|
child: TextCustom(text: 'Ciências',)
|
|
),
|
|
Container(
|
|
alignment: Alignment.center,
|
|
width: Dimensoes.width*0.1,
|
|
child: TextCustom(text: '4',)
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
Column(
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
children: [
|
|
TextCustom(text: 'Presenças',fontWeight: FontWeight.bold,),
|
|
Stack(
|
|
children: [
|
|
Container(
|
|
alignment: Alignment.topCenter,
|
|
width: 150,
|
|
height: 110,
|
|
child: graph(context)
|
|
),
|
|
Container(
|
|
alignment: Alignment.center,
|
|
width: 150,
|
|
height: 110,
|
|
child: TextCustom(text: '90%',size: 14.0,)
|
|
)
|
|
],
|
|
)
|
|
],
|
|
)
|
|
],
|
|
),
|
|
),
|
|
),
|
|
SizedBox(
|
|
height: Dimensoes.height*0.03,
|
|
),
|
|
Card(
|
|
margin: EdgeInsets.symmetric(horizontal: 30),
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(8.0),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
TextCustom(text: 'Próximos Eventos',fontWeight: FontWeight.bold,),
|
|
Row(
|
|
children: [
|
|
Container(
|
|
width: Dimensoes.width*0.5,
|
|
child: TextCustom(text: 'Viagem para o Museu',)
|
|
),
|
|
Container(
|
|
alignment: Alignment.center,
|
|
width: Dimensoes.width*0.3,
|
|
child: TextCustom(text: '01/06/2023',)
|
|
),
|
|
],
|
|
),
|
|
Row(
|
|
children: [
|
|
Container(
|
|
width: Dimensoes.width*0.5,
|
|
child: TextCustom(text: 'Apresentação dia dos pais',)
|
|
),
|
|
Container(
|
|
alignment: Alignment.center,
|
|
width: Dimensoes.width*0.3,
|
|
child: TextCustom(text: '13/08/2023',)
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
SizedBox(
|
|
height: Dimensoes.height*0.03,
|
|
),
|
|
Card(
|
|
margin: EdgeInsets.symmetric(horizontal: 30),
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(8.0),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
TextCustom(text: 'Próximas Datas - Agenda',fontWeight: FontWeight.bold,),
|
|
Row(
|
|
children: [
|
|
Container(
|
|
width: Dimensoes.width*0.5,
|
|
child: TextCustom(text: 'Feriado Corpus Chisti',)
|
|
),
|
|
Container(
|
|
alignment: Alignment.center,
|
|
width: Dimensoes.width*0.3,
|
|
child: TextCustom(text: '08/06/2023',)
|
|
),
|
|
],
|
|
),
|
|
Row(
|
|
children: [
|
|
Container(
|
|
width: Dimensoes.width*0.5,
|
|
child: TextCustom(text: 'Início Férias',)
|
|
),
|
|
Container(
|
|
alignment: Alignment.center,
|
|
width: Dimensoes.width*0.3,
|
|
child: TextCustom(text: '19/07/2023',)
|
|
),
|
|
],
|
|
),
|
|
Row(
|
|
children: [
|
|
Container(
|
|
width: Dimensoes.width*0.5,
|
|
child: TextCustom(text: 'Início 3 bimestre',)
|
|
),
|
|
Container(
|
|
alignment: Alignment.center,
|
|
width: Dimensoes.width*0.3,
|
|
child: TextCustom(text: '30/07/2023',)
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
class _ChartData {
|
|
_ChartData(this.x, this.y, this.color);
|
|
|
|
final String x;
|
|
final double y;
|
|
final Color color;
|
|
}
|