Context class
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
)
}
}
Constructors
-
Context({List<
String> prefixes = const [], bool prod = false, List<String> suffixes = const [], String packId = '', String file = '', String? loadFile = 'load', String? mainFile = 'main', double version = 20, Path path = const Path([]), 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:
- Context.clone(Context context)
Properties
- file ↔ String
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- loadFile ↔ String?
-
getter/setter pair
- mainFile ↔ String?
-
getter/setter pair
- packId ↔ String
-
getter/setter pair
- path ↔ Path
-
getter/setter pair
-
prefixes
↔ List<
String> -
getter/setter pair
- prod ↔ bool
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
suffixes
↔ List<
String> -
getter/setter pair
- version ↔ double
-
getter/setter pair
Methods
-
addPath(
Path p) → Context -
addPrefix(
String? prev) → Context -
addSuffix(
String? suf) → Context -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
passTrait<
T> (T t) → void -
toString(
) → String -
A string representation of this object.
inherited
-
traitOf<
T> () → T
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited