load method

Future<ZdsThemeData> load()

Loads theme data from local storage or assets.

Returns an instance of ZdsThemeData either from a saved JSON string in preferences or from assets.

Implementation

Future<ZdsThemeData> load() async {
  final json = preferences.getString('zds.theme.preferences.json');
  if (json != null) {
    return ZdsThemeData.fromJsonString(json);
  } else if (assetPath != null) {
    return ZdsThemeData.fromAssets(assetPath!);
  } else {
    return ZdsThemeData.defaultData();
  }
}