Gun class
The core Gun class.
You can create a new instance of Gun by calling the constructor:
final gun = Gun(peers: ['https://gun.example.com/gun']);
and then use it to access the data:
final node = gun.get('some/path');
node.put({'some': 'data'});
node.on((data, key) => print(data));
final user = gun.user();
See also User for more information about user authentication.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addPeers(
List< String> peers) → Gun - Change the configuration of the gun database instance.
-
back(
{int? amount}) → Gun - Move up to the parent context on the chain.
-
get(
String sub) → Gun -
Returns a the node at the given
sub
. -
map(
) → Gun - Iterate on each property of a node.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
off(
) → Gun - Unsubscribe from changes.
-
on(
dynamic cb(dynamic data, String key)) → Gun - Apply the callback function to each change of the document.
-
once(
dynamic cb(dynamic data, String key)) → Gun - Apply the callback function once without subscribing to changes.
-
peers(
) → List< Peer> - Returns the peers of the Gun instance.
-
put(
dynamic data) → Gun -
Integrates
data
in a node. -
set(
dynamic data) → Gun -
Adds a unique
data
to a node. -
toString(
) → String -
A string representation of this object.
inherited
-
user(
[String? userPublicKey]) → User - Returns a new instance of User from the current instance of Gun.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited