getTokenSets function
List<String>
getTokenSets(
- Map<
String, dynamic> tokens, { - required BuilderConfig config,
- bool includeDefaultSet = false,
Parses token sets from token data and returns a list of all available tokens sets.
Removed the default set from the output.
Implementation
List<String> getTokenSets(
Map<String, dynamic> tokens, {
required BuilderConfig config,
bool includeDefaultSet = false,
}) {
final tokenSets = List<String>.from(
(tokens['\$metadata']['tokenSetOrder'] as List).cast<String>(),
);
if (!includeDefaultSet) {
tokenSets.remove(config.defaultSetName);
}
return tokenSets;
}