made captcha json-serializable
This commit is contained in:
parent
3aa92f695d
commit
101c7c4afc
|
@ -1,10 +1,22 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
part 'captcha.g.dart';
|
||||
|
||||
/// based on https://dev.lemmy.ml/docs/contributing_websocket_http_api.html#get-captcha
|
||||
@JsonSerializable(fieldRename: FieldRename.snake, createToJson: false)
|
||||
class Captcha {
|
||||
final String png;
|
||||
|
||||
/// can be null
|
||||
final String wav;
|
||||
final String uuid;
|
||||
Captcha({@required this.png, this.wav, @required this.uuid});
|
||||
|
||||
const Captcha({
|
||||
this.png,
|
||||
this.wav,
|
||||
this.uuid
|
||||
});
|
||||
|
||||
factory Captcha.fromJson(Map<String, dynamic> json) =>
|
||||
_$CaptchaFromJson(json);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue