Untitled

mail@pastecode.io avatar
unknown
dart
2 years ago
403 B
1
Indexable
Never
void updateTokens(BuildContext context) async{
    String accessTokenExpire = appUser.state.tokens!.access!.expires!;
    DateTime accessdateTime = DateTime.parse(accessTokenExpire);
    int timeDefrince = accessdateTime.minute.compareTo(DateTime.now().minute);
    if ((timeDefrince * -1) > 14) {
      // function for update token
      refreshToken.state = await Api().updaetToken(context);
    }
  }