65 lines
1.7 KiB
Dart
65 lines
1.7 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:resume/widgets/content_list_tile.dart';
|
|
import 'package:resume/widgets/skill_list_tile.dart';
|
|
|
|
class ContentBox extends StatelessWidget {
|
|
const ContentBox({
|
|
super.key,
|
|
required this.title,
|
|
required this.content,
|
|
required this.contentType,
|
|
});
|
|
|
|
final ContentType contentType;
|
|
final List<dynamic> content;
|
|
final String title;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Column(
|
|
mainAxisSize: MainAxisSize.max,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(
|
|
title,
|
|
style: Theme.of(context).textTheme.headlineMedium,
|
|
),
|
|
ListView.builder(
|
|
shrinkWrap: true,
|
|
itemCount: content.length,
|
|
itemBuilder: (context, index) => _buildListTile(content[index]),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
|
|
Widget _buildListTile(Map data) {
|
|
switch (contentType) {
|
|
case ContentType.experience:
|
|
return ContentListTile(
|
|
name: data['name'],
|
|
location: data['location'],
|
|
title: data['title'],
|
|
description: data['description'],
|
|
startDate: data['startDate'],
|
|
endDate: data['endDate'],
|
|
);
|
|
case ContentType.education:
|
|
return ContentListTile(
|
|
name: data['name'],
|
|
location: data['location'],
|
|
title: data['title'],
|
|
startDate: data['startDate'],
|
|
endDate: data['endDate'],
|
|
);
|
|
case ContentType.skills:
|
|
return SkillListTile(
|
|
name: data['name'],
|
|
percentage: data['percentage'],
|
|
);
|
|
}
|
|
}
|
|
}
|
|
|
|
enum ContentType { experience, education, skills }
|