redux +
null-safety-migration
error500 2021-09-07 12:28:04 +06:00
parent b269c780e7
commit af22647320
3 changed files with 8 additions and 5 deletions

View File

@ -5,9 +5,10 @@ class TransactionData {
TransactionData();
TransactionData.fromMap(dynamic map) {
contragentName = map['contragentName'] as String;
card = map['card'] as double;
nal = map['nal'] as double;
contragentName = cast<String>(map['contragentName']) ?? '';
card = cast<double>(map['card']) ?? 0;
nal = cast<double>(map['nal']) ?? 0;
total = cast<double>(map['total']) ?? 0;
sellResponse = map['sellResponse'] != null
? SellResponse.fromMap(map['sellResponse'])
: null;
@ -24,6 +25,7 @@ class TransactionData {
'contragentName': contragentName,
'card': card,
'nal': nal,
'total' : total,
'sellResponse': sellResponse
};
return map;

View File

@ -51,7 +51,7 @@ Future<void> loadJournalData(Store<AppState> store) async {
' and $transactionColumnStatus = ?'
' and $transactionColumnType = ?',
[appCompanyId, transactionStatusFinish, transactionTypeSell],
orderBy: '$transactionColumnCreatedAt desc');
orderBy: '$transactionColumnCreatedAt asc');
log.i(set.length);
final List<TransactionDao> list = [];

View File

@ -81,6 +81,7 @@ class DataService extends BaseService {
data.nal = nal;
data.total = total;
transaction.data = jsonEncode(data.toMap());
log.i(jsonEncode(data.toMap()));
await _db.update(transactionTableName, transaction.toMap());
}