diff --git a/lib/services/content_provider.dart b/lib/services/content_provider.dart new file mode 100644 index 0000000..1f19c19 --- /dev/null +++ b/lib/services/content_provider.dart @@ -0,0 +1,27 @@ +import 'dart:convert'; + +import 'package:flutter/services.dart'; + +class ContentProvider { + ContentProvider._(); + + static const String _jsonPath = 'assets/content.json'; + + static Future init() async { + try { + String file = await rootBundle.loadString(_jsonPath); + _content = json.decode(file); + } catch (e) { + return false; + } + return true; + } + + static Map _content = {}; + + static List get experience => _content['experience']; + + static List> get education => _content['education']; + + static List> get skills => _content['skills']; +}