Files
rkm_educa_app/lib/screens/seleciona_filho_screen.dart
2023-06-05 11:22:10 -03:00

111 lines
4.2 KiB
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/widgets/appbar_custom.dart';
import '../utils/colors.dart';
import '../widgets/buttom_custom.dart';
import '../widgets/snackBars.dart';
import '../widgets/text_custom.dart';
class SelecionaFilhoScreen extends StatefulWidget {
const SelecionaFilhoScreen({Key? key}) : super(key: key);
@override
State<SelecionaFilhoScreen> createState() => _SelecionaFilhoScreenState();
}
class _SelecionaFilhoScreenState extends State<SelecionaFilhoScreen> {
AlunoModel? alunoModel;
List<AlunoModel> alunos = [
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),
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
Widget build(BuildContext context) {
double height = MediaQuery.of(context).size.height;
double width = MediaQuery.of(context).size.width;
return Scaffold(
backgroundColor: PaletteColors.white,
appBar: AppBarCustom().appbar(context, 'SELECIONAR FILHO'),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
child: Image.asset("assets/images/logoEduca.png",width:width * 0.4,height: height * 0.12)
),
SizedBox(height: height * 0.02),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
TextCustom(text: 'Estudantes',fontWeight: FontWeight.bold,size: 14.0,),
Container(
width: width*0.8,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5),
border: Border.all(
color: Colors.white
),
color: PaletteColors.greyInput
),
child: DropdownButtonHideUnderline(
child: DropdownButton(
hint: Padding(
padding: const EdgeInsets.all(8.0),
child: TextCustom(text: 'Selecione'),
),
value: alunoModel,
items: alunos.map((value) => DropdownMenuItem(
value: value,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: TextCustom(
text: value.nome,
color: Colors.black54,
),
),
)
).toList(),
onChanged: (value){
setState(() {
alunoModel = value!;
});
},
),
),
),
],
),
SizedBox(height: height * 0.02),
ButtonCustom(
widthCustom: 0.7,
heightCustom: 0.07,
text: "Avançar",
size: 14.0,
colorText: PaletteColors.white,
colorButton: PaletteColors.primaryColor,
colorBorder: PaletteColors.primaryColor,
onPressed: () {
if(alunoModel!=null){
Navigator.push(
context,
MaterialPageRoute(builder: (context) => SituacaoEscolarScreen(alunoModel: alunoModel!,)),
);
}else{
showSnackBar(context, 'Selecione um estudante para avançar', Colors.red);
}
},
),
SizedBox(height: height * 0.02),
],
),
)
);
}
}