mirror of
https://github.com/qinglong-app/qinglong_app.git
synced 2025-10-09 16:48:19 +08:00
同步ios的功能
This commit is contained in:
2
lib/module/env/add_env_page.dart
vendored
2
lib/module/env/add_env_page.dart
vendored
@@ -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();
|
||||
|
||||
6
lib/module/env/env_bean.dart
vendored
6
lib/module/env/env_bean.dart
vendored
@@ -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'];
|
||||
|
||||
Reference in New Issue
Block a user