mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-15 21:03:41 +00:00
feat: flutter ui integration
This commit is contained in:
1 parent
0fc133e46d
commit
c4a30dc4c2
170 files changed
+7783
-1
No files matched your search
@@ -0,0 +1,26 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'result.g.dart';
|
||||
|
||||
@JsonSerializable(genericArgumentFactories: true)
|
||||
class Result<T> {
|
||||
String? msg;
|
||||
T? data;
|
||||
|
||||
Result({
|
||||
this.msg,
|
||||
this.data,
|
||||
});
|
||||
|
||||
factory Result.fromJson(
|
||||
Map<String, dynamic> json,
|
||||
T Function(dynamic json) fromJsonT,
|
||||
) =>
|
||||
_$ResultFromJson(json, fromJsonT);
|
||||
Map<String, dynamic> toJson() => {
|
||||
'msg': msg,
|
||||
'data': data is List
|
||||
? (data as dynamic)?.map((e) => e.toJson()).toList()
|
||||
: (data as dynamic)?.toJson(),
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user