createFromFile static method

Future<Rendertheme> createFromFile(
  1. String filename, {
  2. Set<String> excludeIds = const {},
})

Builds and returns a rendertheme by loading a rendertheme file. This is a convienience-function. If desired we can also implement some caching so that we do not need to parse the same file over and over again.

Implementation

static Future<Rendertheme> createFromFile(String filename, {Set<String> excludeIds = const {}}) async {
  File file = File(filename);
  List<int> bytes = await file.readAsBytes();
  String content = const Utf8Decoder().convert(bytes);
  return RenderThemeBuilder.createFromString(content, excludeIds: excludeIds);
}