import 'package:flutter/material.dart'; import 'package:unit2/model/profile/educational_background.dart'; import 'package:unit2/theme-data.dart/box_shadow.dart'; import 'package:unit2/theme-data.dart/colors.dart'; import 'package:unit2/utils/text_container.dart'; class EducationScreen extends StatefulWidget { final List educationBackgrounds; const EducationScreen({super.key, required this.educationBackgrounds}); @override State createState() => _EducationScreenState(); } class _EducationScreenState extends State { @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: const Text(educationScreenTitle), centerTitle: true, backgroundColor: primary, ), body: ListView.builder( padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 10), 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? honors = widget.educationBackgrounds[index].honors!.toList(); String school = widget.educationBackgrounds[index].education!.school!.name!; return Column( children: [ Container( decoration: box1(), padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8), child: Row( children: [ Expanded( child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( children: [ Expanded( child: Text( level, style: Theme.of(context) .textTheme .titleMedium! .copyWith(fontWeight: FontWeight.w500), )), Text( "$periodFrom - $periodTo", style: Theme.of(context).textTheme.bodyMedium, ), ], ), const SizedBox(height: 5,), Text( school, style: Theme.of(context).textTheme.titleSmall, ), Container( padding: const EdgeInsets.only(top: 8), child: honors.isNotEmpty ? Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ const Text("$honorsText : "), Column( children: honors .map((Honor honor) => Text(" ${honor.name!}")) .toList(), ), ], ) : const SizedBox()), program == null ? const SizedBox() : Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ const SizedBox( height: 5, ), Text(program), ], ), ]), ), IconButton( onPressed: () {}, icon: const Icon( Icons.more_vert, color: Colors.grey, )) ], ), ), const SizedBox( height: 5, ), ], ); }), ); } }