|
|
|
|
|
|
|
|
import 'package:farm_tpf/utils/const_common.dart'; |
|
|
import 'package:farm_tpf/utils/const_common.dart'; |
|
|
import 'package:farm_tpf/utils/const_string.dart'; |
|
|
import 'package:farm_tpf/utils/const_string.dart'; |
|
|
import 'package:farm_tpf/utils/const_style.dart'; |
|
|
import 'package:farm_tpf/utils/const_style.dart'; |
|
|
|
|
|
import 'package:farm_tpf/utils/pref.dart'; |
|
|
import 'package:farm_tpf/utils/validators.dart'; |
|
|
import 'package:farm_tpf/utils/validators.dart'; |
|
|
import 'package:flutter/material.dart'; |
|
|
import 'package:flutter/material.dart'; |
|
|
import 'package:flutter_bloc/flutter_bloc.dart'; |
|
|
import 'package:flutter_bloc/flutter_bloc.dart'; |
|
|
|
|
|
|
|
|
TextEditingController _l3Controller = TextEditingController(); |
|
|
TextEditingController _l3Controller = TextEditingController(); |
|
|
TextEditingController _removedQuantityController = TextEditingController(); |
|
|
TextEditingController _removedQuantityController = TextEditingController(); |
|
|
TextEditingController _descriptionController = TextEditingController(); |
|
|
TextEditingController _descriptionController = TextEditingController(); |
|
|
|
|
|
final _executeByController = TextEditingController(); |
|
|
|
|
|
|
|
|
|
|
|
var pref = LocalPref(); |
|
|
List<Harvest> _harvests = List<Harvest>(); |
|
|
List<Harvest> _harvests = List<Harvest>(); |
|
|
Harvest harvestValue; |
|
|
Harvest harvestValue; |
|
|
String executeTimeView; |
|
|
String executeTimeView; |
|
|
|
|
|
|
|
|
List<String> filePaths = List<String>(); |
|
|
List<String> filePaths = List<String>(); |
|
|
var changeFileController = Get.put(ChangeFileController()); |
|
|
var changeFileController = Get.put(ChangeFileController()); |
|
|
|
|
|
|
|
|
|
|
|
Future<Null> getSharedPrefs() async { |
|
|
|
|
|
var currentFullName = await pref.getString(DATA_CONST.CURRENT_FULL_NAME); |
|
|
|
|
|
_executeByController.text = currentFullName ?? ""; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@override |
|
|
@override |
|
|
void initState() { |
|
|
void initState() { |
|
|
super.initState(); |
|
|
super.initState(); |
|
|
|
|
|
getSharedPrefs(); |
|
|
changeFileController.initValue(); |
|
|
changeFileController.initValue(); |
|
|
var parsedExecuteDate = |
|
|
var parsedExecuteDate = |
|
|
DateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'").format(executeTime); |
|
|
DateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'").format(executeTime); |
|
|
|
|
|
|
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Widget _executeByField() { |
|
|
|
|
|
return TextFormField( |
|
|
|
|
|
keyboardType: TextInputType.text, |
|
|
|
|
|
decoration: InputDecoration(labelText: "Người thực hiện"), |
|
|
|
|
|
enabled: false, |
|
|
|
|
|
controller: _executeByController, |
|
|
|
|
|
onSaved: (newValue) {}, |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
_actionAppBar() { |
|
|
_actionAppBar() { |
|
|
IconButton iconButton; |
|
|
IconButton iconButton; |
|
|
if (1 == 1) { |
|
|
if (1 == 1) { |
|
|
|
|
|
|
|
|
.formatNumtoStringDecimal(); |
|
|
.formatNumtoStringDecimal(); |
|
|
_descriptionController.text = |
|
|
_descriptionController.text = |
|
|
_packing.description ?? ""; |
|
|
_packing.description ?? ""; |
|
|
|
|
|
_executeByController.text = _packing.executeBy; |
|
|
|
|
|
|
|
|
//select harvest |
|
|
//select harvest |
|
|
getHarvestBloc.getHarvests((data) { |
|
|
getHarvestBloc.getHarvests((data) { |
|
|
|
|
|
|
|
|
SizedBox( |
|
|
SizedBox( |
|
|
height: 8.0, |
|
|
height: 8.0, |
|
|
), |
|
|
), |
|
|
|
|
|
_executeByField(), |
|
|
|
|
|
SizedBox( |
|
|
|
|
|
height: 8.0, |
|
|
|
|
|
), |
|
|
BlocBuilder<MediaHelperBloc, MediaHelperState>( |
|
|
BlocBuilder<MediaHelperBloc, MediaHelperState>( |
|
|
builder: (context, state) { |
|
|
builder: (context, state) { |
|
|
if (state is MediaHelperSuccess) { |
|
|
if (state is MediaHelperSuccess) { |
|
|
|
|
|
|
|
|
_l3Controller.dispose(); |
|
|
_l3Controller.dispose(); |
|
|
_removedQuantityController.dispose(); |
|
|
_removedQuantityController.dispose(); |
|
|
_descriptionController.dispose(); |
|
|
_descriptionController.dispose(); |
|
|
|
|
|
_executeByController.dispose(); |
|
|
super.dispose(); |
|
|
super.dispose(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |