28 lines
615 B
Dart
28 lines
615 B
Dart
import 'dart:convert';
|
|
|
|
import 'package:flutter/services.dart';
|
|
|
|
class ContentProvider {
|
|
ContentProvider._();
|
|
|
|
static const String _jsonPath = 'assets/content.json';
|
|
|
|
static Future<bool> init() async {
|
|
try {
|
|
String file = await rootBundle.loadString(_jsonPath);
|
|
_content = json.decode(file);
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
static Map<String, dynamic> _content = {};
|
|
|
|
static List<dynamic> get experience => _content['experience'];
|
|
|
|
static List<dynamic> get education => _content['education'];
|
|
|
|
static List<dynamic> get skills => _content['skills'];
|
|
}
|