fetchTransactionsByUser static method

Future fetchTransactionsByUser(
  1. String userId
)

Implementation

static Future<dynamic> fetchTransactionsByUser(String userId) async {
  try {
    final result = await _channel.invokeMethod('fetchTransactionsByUser', {
      'userId': userId,
    });

    print("FETCH TRANSACTIONS BY USERS RESULT = ${result}");

    final transactions = json.decode(result);

    return transactions;
  } on PlatformException catch (exception) {
    return exception;
  }
}