Refactoring
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user