2023-02-07 01:29:38 +00:00
|
|
|
import 'package:flutter/material.dart';
|
2023-02-09 08:48:19 +00:00
|
|
|
|
2023-02-07 01:29:38 +00:00
|
|
|
import 'package:unit2/model/profile/educational_background.dart';
|
2023-02-09 08:48:19 +00:00
|
|
|
import 'package:unit2/theme-data.dart/box_shadow.dart';
|
2023-02-07 01:29:38 +00:00
|
|
|
import 'package:unit2/theme-data.dart/colors.dart';
|
2023-02-09 08:48:19 +00:00
|
|
|
import 'package:unit2/utils/text_container.dart';
|
2023-02-10 07:39:00 +00:00
|
|
|
import 'package:unit2/widgets/add_leading.dart';
|
|
|
|
import 'package:unit2/widgets/empty_data.dart';
|
2023-02-07 01:29:38 +00:00
|
|
|
|
2023-02-10 07:39:00 +00:00
|
|
|
class EducationScreen extends StatelessWidget {
|
2023-02-07 01:29:38 +00:00
|
|
|
final List<EducationalBackground> educationBackgrounds;
|
|
|
|
const EducationScreen({super.key, required this.educationBackgrounds});
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Scaffold(
|
|
|
|
appBar: AppBar(
|
2023-02-09 08:48:19 +00:00
|
|
|
title: const Text(educationScreenTitle),
|
2023-02-07 01:29:38 +00:00
|
|
|
centerTitle: true,
|
|
|
|
backgroundColor: primary,
|
2023-02-10 07:39:00 +00:00
|
|
|
actions: [AddLeading(onPressed: (){})],
|
2023-02-07 01:29:38 +00:00
|
|
|
),
|
2023-02-10 07:39:00 +00:00
|
|
|
body: educationBackgrounds.isNotEmpty ? ListView.builder(
|
2023-02-09 08:48:19 +00:00
|
|
|
padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 10),
|
2023-02-10 07:39:00 +00:00
|
|
|
itemCount: educationBackgrounds.length,
|
2023-02-07 01:29:38 +00:00
|
|
|
itemBuilder: (BuildContext context, int index) {
|
2023-02-10 07:39:00 +00:00
|
|
|
String level = educationBackgrounds[index].education!.level!;
|
|
|
|
String periodFrom = educationBackgrounds[index].periodFrom!;
|
|
|
|
String periodTo = educationBackgrounds[index].periodTo!;
|
2023-02-09 08:48:19 +00:00
|
|
|
String? program =
|
2023-02-10 07:39:00 +00:00
|
|
|
educationBackgrounds[index].education!.course == null
|
2023-02-09 08:48:19 +00:00
|
|
|
? null
|
2023-02-10 07:39:00 +00:00
|
|
|
: educationBackgrounds[index].education!.course!
|
2023-02-09 08:48:19 +00:00
|
|
|
.program!;
|
|
|
|
List<Honor>? honors =
|
2023-02-10 07:39:00 +00:00
|
|
|
educationBackgrounds[index].honors!.toList();
|
2023-02-09 08:48:19 +00:00
|
|
|
String school =
|
2023-02-10 07:39:00 +00:00
|
|
|
educationBackgrounds[index].education!.school!.name!;
|
2023-02-07 01:29:38 +00:00
|
|
|
return Column(
|
|
|
|
children: [
|
|
|
|
Container(
|
2023-02-09 08:48:19 +00:00
|
|
|
decoration: box1(),
|
2023-02-07 01:29:38 +00:00
|
|
|
padding:
|
|
|
|
const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
Expanded(
|
2023-02-09 08:48:19 +00:00
|
|
|
child: Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
2023-02-07 01:29:38 +00:00
|
|
|
children: [
|
2023-02-09 08:48:19 +00:00
|
|
|
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: [
|
2023-02-10 07:39:00 +00:00
|
|
|
const Text("$honorsText : ",style: TextStyle(fontWeight: FontWeight.w600),),
|
2023-02-09 08:48:19 +00:00
|
|
|
Column(
|
|
|
|
children:
|
|
|
|
|
|
|
|
honors
|
|
|
|
.map((Honor honor) =>
|
2023-02-10 07:39:00 +00:00
|
|
|
Text(" - ${honor.name!}"))
|
2023-02-09 08:48:19 +00:00
|
|
|
.toList(),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
)
|
|
|
|
: const SizedBox()),
|
|
|
|
program == null
|
|
|
|
? const SizedBox()
|
|
|
|
: Column(
|
|
|
|
mainAxisAlignment:
|
|
|
|
MainAxisAlignment.start,
|
|
|
|
crossAxisAlignment:
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
const SizedBox(
|
|
|
|
height: 5,
|
|
|
|
),
|
|
|
|
Text(program),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
]),
|
2023-02-07 01:29:38 +00:00
|
|
|
),
|
|
|
|
IconButton(
|
2023-02-09 08:48:19 +00:00
|
|
|
onPressed: () {},
|
|
|
|
icon: const Icon(
|
|
|
|
Icons.more_vert,
|
|
|
|
color: Colors.grey,
|
|
|
|
))
|
2023-02-07 01:29:38 +00:00
|
|
|
],
|
|
|
|
),
|
2023-02-09 08:48:19 +00:00
|
|
|
),
|
|
|
|
const SizedBox(
|
|
|
|
height: 5,
|
|
|
|
),
|
2023-02-07 01:29:38 +00:00
|
|
|
],
|
|
|
|
);
|
2023-02-10 07:39:00 +00:00
|
|
|
}):const EmptyData(message: "You don't have any Educational Background added. Please click + to add."),
|
2023-02-07 01:29:38 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|