Покупка +
parent
94b1e7a79a
commit
69c98ca7c8
|
|
@ -185,7 +185,6 @@ Future<void> removeAllSellData(Store<AppState> store) async {
|
|||
|
||||
Future<void> loadSellData(Store<AppState> store) async {
|
||||
try {
|
||||
log.i('loadSellData');
|
||||
final int? appCompanyId = store.state.userState!.auth!.companyId;
|
||||
final List<Map<String, dynamic>> set = await _dbService.queryRowsWithWhere(
|
||||
transactionTableName,
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
|||
import 'package:infinite_scroll_pagination/infinite_scroll_pagination.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:satu/core/models/inventarization/response/inventarization_response.dart';
|
||||
import 'package:satu/core/services/dialog_service.dart';
|
||||
import 'package:satu/core/services/inventarization_service.dart';
|
||||
import 'package:satu/core/services/navigator_service.dart';
|
||||
import 'package:satu/core/utils/locator.dart';
|
||||
|
|
@ -22,9 +23,9 @@ class InventarizationView extends StatefulWidget {
|
|||
}
|
||||
|
||||
class _InventarizationViewState extends State<InventarizationView> {
|
||||
|
||||
final InventarizationService _service = locator<InventarizationService>();
|
||||
final NavigatorService _navigatorService = locator<NavigatorService>();
|
||||
final DialogService _dialogService = locator<DialogService>();
|
||||
|
||||
static const _pageSize = 20;
|
||||
|
||||
|
|
@ -99,12 +100,18 @@ class _InventarizationViewState extends State<InventarizationView> {
|
|||
);
|
||||
},
|
||||
pagingController: _pagingController,
|
||||
builderDelegate: PagedChildBuilderDelegate<InventarizationResponse>(
|
||||
itemBuilder: (BuildContext context, InventarizationResponse item,
|
||||
int index) {
|
||||
builderDelegate:
|
||||
PagedChildBuilderDelegate<InventarizationResponse>(
|
||||
itemBuilder: (BuildContext context,
|
||||
InventarizationResponse item, int index) {
|
||||
return DictionaryTile(
|
||||
key: Key('category_${item.id}'),
|
||||
onPress: () async {
|
||||
if (item.act != null) {
|
||||
return _dialogService.showDialog(
|
||||
description:
|
||||
'В обработанный акт нельзя добавить товары');
|
||||
}
|
||||
final dynamic result = await _navigatorService
|
||||
.push(inventarizationEditRoute, arguments: item);
|
||||
if (result != null && true == (result as bool)) {
|
||||
|
|
@ -144,8 +151,8 @@ class _InventarizationViewState extends State<InventarizationView> {
|
|||
}
|
||||
|
||||
Future<void> _fetchData(int pageKey, int perPage) async {
|
||||
final List<InventarizationResponse> newItems = await _service
|
||||
.getList(page: pageKey, perpage: perPage);
|
||||
final List<InventarizationResponse> newItems =
|
||||
await _service.getList(page: pageKey, perpage: perPage);
|
||||
final isLastPage = newItems.length < _pageSize;
|
||||
if (isLastPage) {
|
||||
_pagingController.appendLastPage(newItems);
|
||||
|
|
|
|||
Loading…
Reference in New Issue