passo_mobile_app/lib/screens/profile/components/education_screen.dart

72 lines
2.9 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/framework.dart';
import 'package:flutter/src/widgets/placeholder.dart';
import 'package:unit2/model/profile/educational_background.dart';
import 'package:unit2/theme-data.dart/colors.dart';
class EducationScreen extends StatefulWidget {
final List<EducationalBackground> educationBackgrounds;
const EducationScreen({super.key, required this.educationBackgrounds});
@override
State<EducationScreen> createState() => _EducationScreenState();
}
class _EducationScreenState extends State<EducationScreen> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text("Educational Background"),
centerTitle: true,
backgroundColor: primary,
),
body: ListView.builder(
itemCount: widget.educationBackgrounds.length,
itemBuilder: (BuildContext context, int index) {
String level = widget.educationBackgrounds[index].education!.level!;
String periodFrom = widget.educationBackgrounds[index].periodFrom!;
String periodTo = widget.educationBackgrounds[index].periodTo!;
String? program = widget.educationBackgrounds[index].education!.course == null? null: widget.educationBackgrounds[index].education!.course!.program!;
List<Honor>? honors = widget.educationBackgrounds[index].honors!.toList();
String school = widget.educationBackgrounds[index].education!.school!.name!;
return Column(
children: [
Container(
decoration: BoxDecoration(
color: Colors.grey[200],
borderRadius:
const BorderRadius.all(Radius.circular(12))),
padding:
const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
child: Row(
children: [
Expanded(
child: Column(children: [
Row(
children: [
Text(level),
Text("$periodFrom $periodTo"),
],
),
Text(program??=''),
Text(school),
Container(
child: honors.isNotEmpty? Column(
children: honors.map((Honor honor) => Text(honor.name!)).toList(),
):const SizedBox()
)
]),
),
IconButton(
onPressed: () {}, icon: const Icon(Icons.more_vert))
],
),
)
],
);
}),
);
}
}