Firestore class
To use Firestore in your Phantom server, you need to either make sure you are running in a google cloud environment or provide a service account key file.
If you are not running on google and want to easily test ensure the following environment variables are set when running. (in intellij, you can set them in the run configuration)
- GCP_PROJECT=<project_id>
- GOOGLE_APPLICATION_CREDENTIALS=<path_to_service_account_key.json>
If you need a custom database name, other than "(default)", or custom auth provider: copy the source of this class then modify the create() call in onStart() to pass the custom database name or custom auth
- Implemented types
- Mixed-in types
- Available extensions
Constructors
Properties
- $hasReferences → bool
-
no setterinherited
- $id → int
-
Returns the identity hash code of this node.
no setterinherited
- $isActive → bool
-
no setterinherited
-
$json
→ Map<
String, dynamic> -
no setterinherited
-
$metadata
↔ Map<
String, dynamic> -
getter/setter pairinherited
- $pool ↔ NodePool?
-
getter/setter pairinherited
- $referenceCount ↔ int
-
getter/setter pairinherited
- $rootNode ↔ bool
-
Whether this node is a root node. If true, it will not be destroyed when depending nodes are destroyed.
getter/setter pairinherited
- $sourceCodeFile → String?
-
no setterinherited
- $sourceFile → String?
-
no setterinherited
- $tag ↔ Object?
-
The tag of the node.
getter/setter pairinherited
-
$traits
→ Set<
Type> -
Returns the traits implemented by this node.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- logger → PLogger
-
Returns the logger for this node.
no setterinherited
- nodeName → String
-
The name of the node. You can use &4chat &(#FF00FF)colors here.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
$allInstanceFields(
[Type? type]) → Iterable< VariableMirror> -
inherited
-
$allInstanceMethods(
[Type? type]) → Iterable< MethodMirror> -
inherited
-
$dependencyFields(
) → Iterable< VariableMirror> -
inherited
-
$hasTrait(
Type trait) → bool -
Returns whether this node has the given trait.
inherited
-
collection(
String id) → CollectionReference -
destroy(
) → Future< void> -
inherited
-
destroyAllOfTypeAndTag(
) → Future< void> -
inherited
-
destroyWithStarter(
) → Future< Future< void> Function()> -
inherited
-
doc(
String id) → DocumentReference -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onStart(
) → Future< void> -
Called when the node is started. This is where you should initialize your node.
If you are using a stateful node, your state was already loaded by this point
override
-
onStop(
) → Future< void> -
Called when the node is stopped. You may still write to your state as
the node will save its state after this method is called.
override
-
restart(
) → Future< void> -
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited