setData method

Future<void> setData(
  1. String nodePath,
  2. dynamic data
)

Adds or updates data at a specified node path in the database.

The nodePath specifies the path within the database where data should be set. The data can be any type of data supported by Firebase Realtime Database. Prints "Data Sent" upon successful data submission.

Implementation

Future<void> setData(String nodePath, dynamic data) async {
  await database.ref(nodePath).set(data);
}