Skip to content

Instantly share code, notes, and snippets.

@vaygeth89
Created October 23, 2021 08:58
Show Gist options
  • Select an option

  • Save vaygeth89/2d709b40e270d8904984ce1348adf187 to your computer and use it in GitHub Desktop.

Select an option

Save vaygeth89/2d709b40e270d8904984ce1348adf187 to your computer and use it in GitHub Desktop.
Serialized class
//Add this
import 'package:json_annotation/json_annotation.dart';
//Add this
part 'renew_access_token.g.dart';
//Add this
@JsonSerializable()
class RenewAccessToken {
String refreshToken;
RenewAccessToken({
required this.refreshToken,
});
//Add this
static RenewAccessToken fromJson(Map<String, dynamic> map) =>
_$RenewAccessTokenFromJson(map);
Map<String, dynamic> toJson() => _$RenewAccessTokenToJson(this);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment