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'; import 'package:unit2/widgets/Leadings/add_leading.dart'; import 'package:unit2/widgets/empty_data.dart'; class EducationScreen extends StatelessWidget { final List educationBackgrounds; const EducationScreen({super.key, required this.educationBackgrounds}); @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: const Text(educationScreenTitle), centerTitle: true, backgroundColor: primary, actions: [AddLeading(onPressed: (){})], ), body: educationBackgrounds.isNotEmpty ? ListView.builder( padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 10), itemCount: educationBackgrounds.length, itemBuilder: (BuildContext context, int index) { String level = educationBackgrounds[index].education!.level!; String periodFrom = educationBackgrounds[index].periodFrom!; String periodTo = educationBackgrounds[index].periodTo!; String? program = educationBackgrounds[index].education!.course == null ? null : educationBackgrounds[index].education!.course! .program!; List? honors = educationBackgrounds[index].honors!.toList(); String school = 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 : ",style: TextStyle(fontWeight: FontWeight.w600),), 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, ), ], ); }):const EmptyData(message: "You don't have any Educational Background added. Please click + to add."), ); } }