|
@@ -19,13 +19,13 @@ class _CreateAddService extends State<CreateAddService> {
|
|
/*服务*/
|
|
/*服务*/
|
|
JXServiceModel _service;
|
|
JXServiceModel _service;
|
|
/*类型*/
|
|
/*类型*/
|
|
- TextEditingController kindController;
|
|
|
|
|
|
+ TextEditingController _kindController = TextEditingController(text: '');
|
|
/*周期*/
|
|
/*周期*/
|
|
- TextEditingController cycleController;
|
|
|
|
|
|
+ final TextEditingController _cycleController = TextEditingController(text: '');
|
|
/*提醒*/
|
|
/*提醒*/
|
|
- TextEditingController remandController;
|
|
|
|
|
|
+ final TextEditingController _remandController = TextEditingController(text: '0');
|
|
/*备注*/
|
|
/*备注*/
|
|
- TextEditingController remarkConotroller;
|
|
|
|
|
|
+ final TextEditingController _remarkConotroller = TextEditingController(text: '');
|
|
|
|
|
|
@override
|
|
@override
|
|
void initState() {
|
|
void initState() {
|
|
@@ -38,10 +38,10 @@ class _CreateAddService extends State<CreateAddService> {
|
|
print('编辑服务');
|
|
print('编辑服务');
|
|
_service = widget.service;
|
|
_service = widget.service;
|
|
/*设置值*/
|
|
/*设置值*/
|
|
- kindController = TextEditingController(text: _service.kind);
|
|
|
|
- cycleController = TextEditingController(text: _service.cycle.toString());
|
|
|
|
- remandController = TextEditingController(text: '0');
|
|
|
|
- remarkConotroller = TextEditingController(text: _service.remark);
|
|
|
|
|
|
+ /*_kindController = TextEditingController(text: _service.kind);
|
|
|
|
+ _cycleController = TextEditingController(text: _service.cycle.toString());
|
|
|
|
+ _remandController = TextEditingController(text: _service.remindDay.toString());
|
|
|
|
+ _remarkConotroller = TextEditingController(text: _service.remark);*/
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -62,10 +62,7 @@ class _CreateAddService extends State<CreateAddService> {
|
|
child: EditCell(
|
|
child: EditCell(
|
|
mark: '类型',
|
|
mark: '类型',
|
|
hint: '请输入类型',
|
|
hint: '请输入类型',
|
|
- controller: kindController,
|
|
|
|
- onEditingComplete: (value){
|
|
|
|
- _service.kind = value;
|
|
|
|
- },
|
|
|
|
|
|
+ controller: _kindController,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
Container(
|
|
@@ -77,13 +74,13 @@ class _CreateAddService extends State<CreateAddService> {
|
|
Expanded(
|
|
Expanded(
|
|
child: SizedBox(width: 0,),
|
|
child: SizedBox(width: 0,),
|
|
),
|
|
),
|
|
- theInputDayView('周期', '个月', cycleController),
|
|
|
|
- theInputDayView('提醒', '日', remandController),
|
|
|
|
|
|
+ theInputDayView('周期', '个月', _cycleController),
|
|
|
|
+ theInputDayView('提醒', '日', _remandController),
|
|
],
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
SizedBox(height: 12.0,),
|
|
SizedBox(height: 12.0,),
|
|
- theRemarkView(remarkConotroller),
|
|
|
|
|
|
+ theRemarkView(_remarkConotroller),
|
|
],
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
@@ -199,15 +196,16 @@ class _CreateAddService extends State<CreateAddService> {
|
|
);
|
|
);
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
/**点击事件**/
|
|
/**点击事件**/
|
|
/*保存*/
|
|
/*保存*/
|
|
void saveBtnClickAction() {
|
|
void saveBtnClickAction() {
|
|
- _service.kind = kindController.text;
|
|
|
|
- _service.cycle = int.parse(cycleController.text);
|
|
|
|
- _service.remindDay = int.parse(remandController.text);
|
|
|
|
- _service.remark = remarkConotroller.text;
|
|
|
|
|
|
+ _service.kind = _kindController.text;
|
|
|
|
+ _service.cycle = int.parse(_cycleController.text);
|
|
|
|
+ _service.remindDay = int.parse(_remandController.text);
|
|
|
|
+ _service.remark = _remarkConotroller.text;
|
|
_service.cycleUnit = '月';
|
|
_service.cycleUnit = '月';
|
|
|
|
+ _service.id = 12;
|
|
print(_service.toMap());
|
|
print(_service.toMap());
|
|
|
|
+ Navigator.of(context).pop(_service);
|
|
}
|
|
}
|
|
}
|
|
}
|