Browse Source

show executeBy action crop status

master
daivph 5 years ago
parent
commit
dd2a75b535
2 changed files with 30 additions and 0 deletions
  1. +4
    -0
      lib/custom_model/CropStatus.dart
  2. +26
    -0
      lib/presentation/screens/actions/crop_status/sc_edit_action_crop_status.dart

+ 4
- 0
lib/custom_model/CropStatus.dart View File

@@ -12,6 +12,7 @@ class CropStatus {
String abilityProduceBuds;
String internodeLength;
String description;
String executeBy;
String media;

CropStatus(
@@ -28,6 +29,7 @@ class CropStatus {
this.abilityProduceBuds,
this.internodeLength,
this.description,
this.executeBy,
this.media});

CropStatus.fromJson(Map<String, dynamic> json) {
@@ -44,6 +46,7 @@ class CropStatus {
abilityProduceBuds = json['abilityProduceBuds'];
internodeLength = json['internodeLength'];
description = json['description'];
executeBy = json['executeBy'];
media = json['media'];
}

@@ -62,6 +65,7 @@ class CropStatus {
data['abilityProduceBuds'] = this.abilityProduceBuds;
data['internodeLength'] = this.internodeLength;
data['description'] = this.description;
data['executeBy'] = this.executeBy;
data['media'] = this.media;
return data;
}

+ 26
- 0
lib/presentation/screens/actions/crop_status/sc_edit_action_crop_status.dart View File

@@ -53,15 +53,22 @@ class _EditActionCropStatusScreenState
TextEditingController _abilityProduceBudsController = TextEditingController();
TextEditingController _internodeLengthController = TextEditingController();
TextEditingController _descriptionController = TextEditingController();
final _executeByController = TextEditingController();

String executeTimeView;
DateTime executeTime = DateTime.now();
List<String> filePaths = List<String>();
var changeFileController = Get.put(ChangeFileController());

Future<Null> getSharedPrefs() async {
var currentFullName = await pref.getString(DATA_CONST.CURRENT_FULL_NAME);
_executeByController.text = currentFullName ?? "";
}

@override
void initState() {
super.initState();
getSharedPrefs();
changeFileController.initValue();
var parsedExecuteDate =
DateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'").format(executeTime);
@@ -347,6 +354,16 @@ class _EditActionCropStatusScreenState
);
}

Widget _executeByField() {
return TextFormField(
keyboardType: TextInputType.text,
decoration: InputDecoration(labelText: "Người thực hiện"),
enabled: false,
controller: _executeByController,
onSaved: (newValue) {},
);
}

_actionAppBar() {
IconButton iconButton;
if (1 == 1) {
@@ -433,6 +450,8 @@ class _EditActionCropStatusScreenState
.formatStringToStringDecimal();
_descriptionController.text =
_cropStatus.description ?? "";
_executeByController.text =
_cropStatus.executeBy ?? "";

try {
executeTime =
@@ -507,6 +526,13 @@ class _EditActionCropStatusScreenState
height: 8.0,
),
_desciptionField(),
SizedBox(
height: 8.0,
),
_executeByField(),
SizedBox(
height: 8.0,
),
BlocBuilder<MediaHelperBloc, MediaHelperState>(
builder: (context, state) {
if (state is MediaHelperSuccess) {

Loading…
Cancel
Save