From 4c2162a158f63026ea4fbf98f5a3f197c0c26330 Mon Sep 17 00:00:00 2001 From: marco Date: Thu, 5 Dec 2024 20:45:00 +0100 Subject: [PATCH] added additional skills --- lib/constants.dart | 9 ++++++++- lib/pages/landing_page.dart | 5 +++++ lib/services/content_provider.dart | 3 +++ lib/widgets/content_block.dart | 11 +++++++++++ 4 files changed, 27 insertions(+), 1 deletion(-) diff --git a/lib/constants.dart b/lib/constants.dart index 5513ab5..d386779 100644 --- a/lib/constants.dart +++ b/lib/constants.dart @@ -14,4 +14,11 @@ const months = [ 'Dezember' ]; -enum ContentType { experience, education, skills, language, text } +enum ContentType { + experience, + education, + skills, + language, + text, + generalSkills +} diff --git a/lib/pages/landing_page.dart b/lib/pages/landing_page.dart index 44ffd95..4571e6b 100644 --- a/lib/pages/landing_page.dart +++ b/lib/pages/landing_page.dart @@ -70,6 +70,11 @@ class _LandingPageState extends State { contentType: ContentType.education, ), Padding(padding: EdgeInsets.only(bottom: 25)), + ContentBlock( + blockTitle: 'Weitere Kenntnisse', + contentType: ContentType.generalSkills, + ), + Padding(padding: EdgeInsets.only(bottom: 25)), ContentBlock( blockTitle: "Über mich", contentType: ContentType.text, diff --git a/lib/services/content_provider.dart b/lib/services/content_provider.dart index 234f123..2da56f3 100644 --- a/lib/services/content_provider.dart +++ b/lib/services/content_provider.dart @@ -23,6 +23,7 @@ class ContentProvider { 'education': >[], 'skills': >[], 'text': [], + 'general_skills': >[], }; static T getContent(ContentType contentType) { @@ -35,6 +36,8 @@ class ContentProvider { return _content['skills'] as T; case ContentType.text: return _content['text'] as T; + case ContentType.generalSkills: + return _content['general_skills'] as T; default: return [] as T; } diff --git a/lib/widgets/content_block.dart b/lib/widgets/content_block.dart index b93cb3c..bac594e 100644 --- a/lib/widgets/content_block.dart +++ b/lib/widgets/content_block.dart @@ -24,6 +24,17 @@ class ContentBlock extends StatelessWidget { width: double.infinity, child: Text(content), ); + } else if (contentType == ContentType.generalSkills) { + final content = + ContentProvider.getContent>(ContentType.generalSkills); + List widgets = []; + for (int i = 0; i < content.length; i++) { + String text = i == content.length - 1 + ? content.elementAt(i) + : content.elementAt(i) + ', '; + widgets.add(Text(text)); + } + return Row(children: widgets); } // List-based content-blocks List content =