同步ios的功能

This commit is contained in:
jyuesong
2022-05-30 14:02:14 +08:00
parent 578bb926fa
commit bd77beb60a
14 changed files with 412 additions and 548 deletions

View File

@@ -187,7 +187,7 @@ class _AddEnvPageState extends ConsumerState<AddEnvPage> {
envBean.remarks = _remarkController.text;
HttpResponse<NullResponse> response = await Api.addEnv(
_nameController.text, _valueController.text, _remarkController.text,
id: envBean.sId);
id: envBean.id,nId: envBean.nId,);
if (response.success) {
(envBean.sId == null) ? "新增成功" : "修改成功".toast();

View File

@@ -4,6 +4,8 @@ import 'package:json_conversion_annotation/json_conversion_annotation.dart';
class EnvBean {
String? value;
String? sId;
String? _id;
int? id;
int? created;
int? status;
String? timestamp;
@@ -12,8 +14,12 @@ class EnvBean {
EnvBean({this.value, this.sId, this.created, this.status, this.timestamp, this.name, this.remarks});
get nId => _id;
EnvBean.fromJson(Map<String, dynamic> json) {
value = json['value'];
id = json['id'];
_id = json['_id'];
sId = json.containsKey('_id') ? json['_id'].toString() : (json.containsKey('id') ? json['id'].toString() : "");
created = int.tryParse(json['created'].toString());
status = json['status'];