cpd_2022_zi/lib/service/json_service.dart

13 lines
378 B
Dart
Raw Normal View History

2023-02-17 13:47:52 +01:00
import 'package:flutter/services.dart';
import 'dart:convert';
const String configJSONPath = 'assets/group3.json';
2023-02-17 13:47:52 +01:00
Future<Map<String, dynamic>> loadLocalConfigJSON() async {
String content = await rootBundle.loadString(configJSONPath);
return jsonDecode(content);
}
List<String>? jsonPropertyAsList(dynamic property) =>
property != null ? List.from(property) : null;