Context constructor

Context({
  1. List<String> prefixes = const [],
  2. bool prod = false,
  3. List<String> suffixes = const [],
  4. String packId = '',
  5. String file = '',
  6. String? loadFile = 'load',
  7. String? mainFile = 'main',
  8. double version = 20.4,
  9. Path path = const Path([]),
  10. Map<String, String?>? macros,
  11. Map<Type, dynamic>? traits,
})

Maybe you already wondered what this context argument here is The Context is a way to get certain important information from the parents. You can use this context to build more modular Widgets and don't need to hardcode certain files and the pack id:

class LoadWidget extends Widget {
	@override
	Widget generate(Context context){
		return Command('function ' + context.packId + ':' + context.loadFile)
	}
}

Implementation

Context({
  this.prefixes = const [],
  this.prod = false,
  this.suffixes = const [],
  this.packId = '',
  this.file = '',
  this.loadFile = 'load',
  this.mainFile = 'main',
  this.version = 20.4,
  this.path = const Path([]),
  Map<String, String?>? macros,
  Map<Type, dynamic>? traits,
})  : _heredityTraits = traits ?? {},
      macros = macros ?? {};