getData static method

String? getData(
  1. String token,
  2. String secretKey
)

Implementation

static String? getData(String token, String secretKey) {
  List<String> segments = token.split('.');
  Map<String, dynamic> payload = jsonDecode(_decrypt(segments[1], secretKey));
  DateTime live = DateTime.parse(payload["live"]);
  if (live.compareTo(DateTime.now()) == -1) {
    return null;
  }

  return payload["data"];
}