Refactoring

This commit is contained in:
2024-12-05 15:54:29 +01:00
parent 3ba6f9d714
commit 7fac0160e0
8 changed files with 305 additions and 207 deletions

View File

@@ -1,6 +1,7 @@
import 'dart:convert';
import 'package:flutter/services.dart';
import 'package:resume/constants.dart';
class ContentProvider {
ContentProvider._();
@@ -17,11 +18,25 @@ class ContentProvider {
return true;
}
static Map<String, dynamic> _content = {};
static Map<String, dynamic> _content = {
'experience': <List<dynamic>>[],
'education': <List<dynamic>>[],
'skills': <List<dynamic>>[],
'text': <String>[],
};
static List<dynamic> get experience => _content['experience'];
static List<dynamic> get education => _content['education'];
static List<dynamic> get skills => _content['skills'];
static T getContent<T>(ContentType contentType) {
switch (contentType) {
case ContentType.experience:
return _content['experience'] as T;
case ContentType.education:
return _content['education'] as T;
case ContentType.skills:
return _content['skills'] as T;
case ContentType.text:
return _content['text'] as T;
default:
return [] as T;
}
}
}