From ae65a7d68663fb952eb632698f8f7fc772b727a3 Mon Sep 17 00:00:00 2001 From: error500 Date: Mon, 15 Nov 2021 18:00:13 +0600 Subject: [PATCH] sell_return --- lib/core/entity/transaction_entity.dart | 1 + .../flow/sell_return/sell_return_request.dart | 16 ++ .../sell_return/sell_return_request.g.dart | 20 ++ lib/core/redux/actions/journal_actions.dart | 25 +- lib/core/services/api_service.dart | 18 ++ lib/core/services/data_service.dart | 119 +++++++- lib/routes/router.dart | 4 +- lib/views/work/tabs/journal_view.dart | 6 +- .../work/views/payment/payment_view.dart | 6 +- .../work/views/receipt/receipt_view.dart | 80 ++++-- pubspec.lock | 270 +++++++++++++++++- pubspec.yaml | 6 +- 12 files changed, 508 insertions(+), 63 deletions(-) create mode 100644 lib/core/models/flow/sell_return/sell_return_request.dart create mode 100644 lib/core/models/flow/sell_return/sell_return_request.g.dart diff --git a/lib/core/entity/transaction_entity.dart b/lib/core/entity/transaction_entity.dart index 8366e04..62f46fc 100644 --- a/lib/core/entity/transaction_entity.dart +++ b/lib/core/entity/transaction_entity.dart @@ -10,6 +10,7 @@ const String transactionColumnUpdatedAt = 'updatedAt'; const int transactionTypeSell = 1; const int transactionTypeBuy = 2; +const int transactionTypeReturnSell = 3; const int transactionStatusPrepare = 0; const int transactionStatusFinish = 7; diff --git a/lib/core/models/flow/sell_return/sell_return_request.dart b/lib/core/models/flow/sell_return/sell_return_request.dart new file mode 100644 index 0000000..c99a3e3 --- /dev/null +++ b/lib/core/models/flow/sell_return/sell_return_request.dart @@ -0,0 +1,16 @@ +import 'package:json_annotation/json_annotation.dart'; + +part 'sell_return_request.g.dart'; + +@JsonSerializable() +class SellReturnRequest { + int journal_id; + String invoice_id; + + SellReturnRequest({required this.journal_id, required this.invoice_id}); + + factory SellReturnRequest.fromJson(Map json) => _$SellReturnRequestFromJson(json); + + Map toJson() => _$SellReturnRequestToJson(this); +} + diff --git a/lib/core/models/flow/sell_return/sell_return_request.g.dart b/lib/core/models/flow/sell_return/sell_return_request.g.dart new file mode 100644 index 0000000..84939ce --- /dev/null +++ b/lib/core/models/flow/sell_return/sell_return_request.g.dart @@ -0,0 +1,20 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'sell_return_request.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +SellReturnRequest _$SellReturnRequestFromJson(Map json) { + return SellReturnRequest( + journal_id: json['journal_id'] as int, + invoice_id: json['invoice_id'] as String, + ); +} + +Map _$SellReturnRequestToJson(SellReturnRequest instance) => + { + 'journal_id': instance.journal_id, + 'invoice_id': instance.invoice_id, + }; diff --git a/lib/core/redux/actions/journal_actions.dart b/lib/core/redux/actions/journal_actions.dart index 6ddbee8..ecf31a6 100644 --- a/lib/core/redux/actions/journal_actions.dart +++ b/lib/core/redux/actions/journal_actions.dart @@ -48,9 +48,14 @@ Future loadJournalData(Store store) async { final List> set = await _dbService.queryRowsWithWhere( transactionTableName, '$transactionColumnAppCompanyId = ?' - ' and $transactionColumnStatus = ?' - ' and $transactionColumnType = ?', - [appCompanyId, transactionStatusFinish, transactionTypeSell], + ' and $transactionColumnStatus = ?' + ' and $transactionColumnType in (?,?)', + [ + appCompanyId, + transactionStatusFinish, + transactionTypeSell, + transactionTypeReturnSell + ], orderBy: '$transactionColumnCreatedAt asc'); log.i(set.length); final List list = []; @@ -60,8 +65,8 @@ Future loadJournalData(Store store) async { for (final Map map in set) { final Transaction transaction = Transaction.fromMap(map); - final TransactionData data = TransactionData.fromMap( - jsonDecode(transaction.data!)); + final TransactionData data = + TransactionData.fromMap(jsonDecode(transaction.data!)); final TransactionDao dao = TransactionDao(); dao.id = transaction.id; final DateTime updateAt = DateTime.parse(transaction.updatedAt!); @@ -70,14 +75,16 @@ Future loadJournalData(Store store) async { dao.contragentName = data.contragentName; dao.number = data.sellResponse?.journalId.toString() ?? ''; dao.total = data.total; + if(transaction.type == transactionTypeReturnSell) { + dao.received = false; + } list.add(dao); } store.dispatch(SetJournalStateAction(JournalState( items: list, ))); - } catch (e, stack) - { - log.e('loadJournalData', e, stack); - } + } catch (e, stack) { + log.e('loadJournalData', e, stack); } +} diff --git a/lib/core/services/api_service.dart b/lib/core/services/api_service.dart index 8b10e27..10ed195 100644 --- a/lib/core/services/api_service.dart +++ b/lib/core/services/api_service.dart @@ -6,6 +6,7 @@ import 'package:http/http.dart' as http; import 'package:satu/core/models/auth/auth_response.dart'; import 'package:satu/core/models/flow/sell_request.dart'; import 'package:satu/core/models/flow/sell_response.dart'; +import 'package:satu/core/models/flow/sell_return/sell_return_request.dart'; import 'package:satu/core/models/response.dart'; /// The service responsible for networking requests @@ -152,4 +153,21 @@ class ApiService extends BaseService { } return response; } + + Future sellReturn(SellReturnRequest request) async { + SellResponse response; + try { + final Map headers = { + HttpHeaders.authorizationHeader: 'Bearer $token' + }; + final String responseBody = await _post('/sell_return', header: headers, requestBody: request.toJson()); + response = SellResponse.fromMap(json.decode(responseBody)); + } catch (e, stack) { + log.e('sellReturn', e, stack); + response = SellResponse() + ..operation = false + ..message = e.toString(); + } + return response; + } } diff --git a/lib/core/services/data_service.dart b/lib/core/services/data_service.dart index de5e8d8..373c46a 100644 --- a/lib/core/services/data_service.dart +++ b/lib/core/services/data_service.dart @@ -9,11 +9,13 @@ import 'package:satu/core/models/flow/operator_bean.dart'; import 'package:satu/core/models/flow/dao/product_dao.dart'; import 'package:satu/core/models/flow/sell_request.dart'; import 'package:satu/core/models/flow/sell_response.dart'; +import 'package:satu/core/models/flow/sell_return/sell_return_request.dart'; import 'package:satu/core/models/flow/transaction_state.dart'; import 'package:satu/core/redux/actions/sell_actions.dart'; import 'package:satu/core/redux/state/sell_state.dart'; import 'package:satu/core/redux/store.dart'; import 'package:satu/core/utils/locator.dart'; +import 'package:uuid/uuid.dart'; import 'api_service.dart'; import 'db_service.dart'; @@ -25,7 +27,7 @@ class DataService extends BaseService { final DialogService _dialogService = locator(); - Future sellBtnHandler( + Future sellBtnHandler( {double card = 0, double nal = 0, double total = 0}) async { final SellRequest request = SellRequest(); final SellState sellState = Redux.store!.state.sellState!; @@ -48,7 +50,7 @@ class DataService extends BaseService { _dialogService.showDialog(description: response.message); return null; } - final TransactionData transactionData = await _updateTransaction( + final int? transactionId = await _updateTransaction( transactionState: transactionState, total: total, card: card, @@ -56,15 +58,58 @@ class DataService extends BaseService { sellResponse: response); await Redux.store!.dispatch(loadSellData); - return transactionData; + return transactionId; } - Future _updateTransaction( - {required TransactionState transactionState, - required double card, - required double nal, - required double total, - SellResponse? sellResponse}) async { + Future returnBtnHandler({required int trId}) async { + Map? map = await _db.queryById(transactionTableName, trId); + if (map != null) { + final Transaction transaction = Transaction.fromMap(map); + final String? data = transaction.data; + if (data != null) { + TransactionData transactionData = + TransactionData.fromMap(jsonDecode(data)); + + const uuidTool = Uuid(); + final String uuid = uuidTool.v4(); + + final SellReturnRequest request = SellReturnRequest( + journal_id: transactionData.sellResponse!.journalId!, + invoice_id: uuid, + ); + final SellResponse response = await _api.sellReturn(request); + if (response.operation == false) { + _dialogService.showDialog(description: response.message); + return null; + } + final int? appCompanyId = Redux.store!.state.userState!.auth!.companyId; + final int? transactionId = await _addTransaction( + uuid: uuid, + contragentName: transactionData.contragentName, + type: transactionTypeReturnSell, + status: transactionStatusFinish, + appCompanyId: appCompanyId!, + total: transactionData.total, + card: transactionData.card, + nal: transactionData.nal, + sellResponse: response, + ); + + await Redux.store!.dispatch(loadSellData); + return transactionId; + } + } + + return null; + } + + Future _updateTransaction({ + required TransactionState transactionState, + required double card, + required double nal, + required double total, + SellResponse? sellResponse, + }) async { final Map? map = await _db.queryById( transactionTableName, transactionState.uuid, idColumnName: transactionColumnUuid); @@ -83,7 +128,39 @@ class DataService extends BaseService { transaction.data = jsonEncode(data.toMap()); log.i(jsonEncode(data.toMap())); await _db.update(transactionTableName, transaction.toMap()); - return data; + return transaction.id; + } + + Future _addTransaction({ + required String uuid, + required double card, + required double nal, + required double total, + required int type, + required int status, + required int appCompanyId, + SellResponse? sellResponse, + String? contragentName, + }) async { + final DateTime now = DateTime.now(); + final Transaction transaction = Transaction(); + final TransactionData data = TransactionData(); + transaction.status = transactionStatusFinish; + transaction.updatedAt = now.toIso8601String(); + transaction.createdAt = now.toIso8601String(); + transaction.appCompanyId = appCompanyId; + transaction.type = type; + transaction.status = status; + transaction.uuid = uuid; + data.sellResponse = sellResponse; + data.contragentName = contragentName ?? ''; + data.card = card; + data.nal = nal; + data.total = total; + transaction.data = jsonEncode(data.toMap()); + log.i(jsonEncode(data.toMap())); + return await _db.insert(transactionTableName, transaction.toMap()); + ; } ItemBean _productToItemBean(ProductDao product) { @@ -98,11 +175,10 @@ class DataService extends BaseService { } Future getTransactionDataById(int? id) async { - if(id == null) return null; + if (id == null) return null; try { - Map? map = await _db.queryById(transactionTableName, id); - if (map != null) { - final Transaction transaction = Transaction.fromMap(map); + Transaction? transaction = await getTransactionById(id); + if (transaction != null) { final String? data = transaction.data; if (data != null) { return TransactionData.fromMap(jsonDecode(data)); @@ -113,4 +189,19 @@ class DataService extends BaseService { } return null; } + + Future getTransactionById(int? id) async { + if (id == null) return null; + try { + Map? map = await _db.queryById(transactionTableName, id); + if (map != null) { + final Transaction transaction = Transaction.fromMap(map); + return transaction; + } + } catch (e, stack) { + log.e('getTransactionById', e, stack); + } + return null; + } + } diff --git a/lib/routes/router.dart b/lib/routes/router.dart index 4bd4647..4d25d66 100644 --- a/lib/routes/router.dart +++ b/lib/routes/router.dart @@ -101,12 +101,12 @@ Route generateRoute(RouteSettings settings) { ); case receiptViewRoute: - final TransactionData data = settings.arguments! as TransactionData; + final int data = settings.arguments! as int; //return SlideRightRoute(widget: ImageShowContainer(data)); return _getPageRoute( routeName: settings.name, viewToShow: ReceiptView( - transactionData: data, + transactionId: data, ), ); default: diff --git a/lib/views/work/tabs/journal_view.dart b/lib/views/work/tabs/journal_view.dart index bf319c2..a6419ff 100644 --- a/lib/views/work/tabs/journal_view.dart +++ b/lib/views/work/tabs/journal_view.dart @@ -135,10 +135,8 @@ class _JournalViewState extends State { Future pushToReceiptView(TransactionDao element) async { final int? id = element.id; - TransactionData? transactionData = - await _dataService.getTransactionDataById(id); - if(transactionData != null) { - _navigatorService.push(receiptViewRoute, arguments: transactionData); + if(id != null) { + _navigatorService.push(receiptViewRoute, arguments: id); } } } diff --git a/lib/views/work/views/payment/payment_view.dart b/lib/views/work/views/payment/payment_view.dart index 7ba5489..7bb4336 100644 --- a/lib/views/work/views/payment/payment_view.dart +++ b/lib/views/work/views/payment/payment_view.dart @@ -166,11 +166,11 @@ class _PaymentViewState extends State { nal = _cashSum; } - final TransactionData? transactionData = + final int? transactionId = await _dataService.sellBtnHandler(card: card, nal: nal, total: _sum); - if (transactionData !=null) { + if (transactionId !=null) { _navigatorService.pop(); - _navigatorService.push(receiptViewRoute, arguments: transactionData); + _navigatorService.push(receiptViewRoute, arguments: transactionId); } setState(() { loading = false; diff --git a/lib/views/work/views/receipt/receipt_view.dart b/lib/views/work/views/receipt/receipt_view.dart index 3106152..22feca0 100644 --- a/lib/views/work/views/receipt/receipt_view.dart +++ b/lib/views/work/views/receipt/receipt_view.dart @@ -5,24 +5,29 @@ import 'package:esc_pos_bluetooth/esc_pos_bluetooth.dart'; import 'package:flutter/material.dart'; import 'package:flutter_redux/flutter_redux.dart'; import 'package:material_design_icons_flutter/material_design_icons_flutter.dart'; +import 'package:satu/core/entity/transaction_entity.dart'; +import 'package:satu/core/models/dialog_models.dart'; import 'package:satu/core/models/entity_data/transaction_data.dart'; import 'package:satu/core/models/flow/sell_response.dart'; import 'package:satu/core/models/settings/printer_setting.dart'; import 'package:satu/core/models/ui_dao/popup_item_dao.dart'; import 'package:satu/core/redux/store.dart'; +import 'package:satu/core/services/data_service.dart'; import 'package:satu/core/services/dialog_service.dart'; +import 'package:satu/core/services/navigator_service.dart'; import 'package:satu/core/utils/locator.dart'; import 'package:satu/core/utils/pos_printer.dart'; +import 'package:satu/routes/route_names.dart'; import 'package:satu/shared/app_colors.dart'; import 'package:satu/widgets/bar/products_app_bar.dart'; class ReceiptView extends StatefulWidget { const ReceiptView({ - required this.transactionData, + required this.transactionId, Key? key, }) : super(key: key); - final TransactionData transactionData; + final int transactionId; @override State createState() => _ReceiptViewState(); @@ -30,18 +35,38 @@ class ReceiptView extends StatefulWidget { class _ReceiptViewState extends State { final DialogService _dialogService = locator(); + final DataService _dataService = locator(); + final NavigatorService _navigatorService = locator(); PrinterBluetoothManager printerManager = PrinterBluetoothManager(); bool printerLocked = false; List menus = []; + TransactionData transactionData = TransactionData(); @override void initState() { - //menus.add(PopupItemDao(code: 'return', name: 'Возврат')); - //menus.add(PopupItemDao(code: 'share', name: 'Поделится')); + loadData(); + super.initState(); } + void loadData() async { + final Transaction? transaction = + await _dataService.getTransactionById(widget.transactionId); + final TransactionData? _transactionData = + await _dataService.getTransactionDataById(widget.transactionId); + + if (transaction != null && transactionTypeSell == transaction.type) { + menus.add(PopupItemDao(code: 'return', name: 'Возврат')); + } + //menus.add(PopupItemDao(code: 'share', name: 'Поделится')); + + setState(() { + transactionData = _transactionData!; + menus = menus; + }); + } + void printRec() async { setState(() { printerLocked = true; @@ -60,13 +85,11 @@ class _ReceiptViewState extends State { if (PrinterConst.encodingBigEncoding == printerSetting.encoding) { data = await getReceiptImg( printerSetting.paperSize!, - base64Decode(widget.transactionData.sellResponse!.checkPng!), + base64Decode(transactionData.sellResponse!.checkPng!), ); } else { - data = await getReceipt( - printerSetting.encoding!, - printerSetting.paperSize!, - widget.transactionData.sellResponse!.check!); + data = await getReceipt(printerSetting.encoding!, + printerSetting.paperSize!, transactionData.sellResponse!.check!); } final PosPrintResult printResult = await printerManager.writeBytes( @@ -85,8 +108,26 @@ class _ReceiptViewState extends State { } } - void onSelectChoice(PopupItemDao itemDao ) { - print(itemDao.code); + void onSelectChoice(PopupItemDao itemDao) { + if ('return' == itemDao.code) { + returnTransaction(); + } + } + + void returnTransaction() async { + DialogResponse dialogResponse = await _dialogService.showConfirmationDialog( + description: 'Вы действительно хотете сделать возврат платежа?', + confirmationTitle: 'Возврат', + cancelTitle: 'Отмена', + ); + if (dialogResponse.confirmed) { + final int? trId = + await _dataService.returnBtnHandler(trId: widget.transactionId); + if (trId != null) { + _navigatorService.pop(); + _navigatorService.push(receiptViewRoute, arguments: trId); + } + } } @override @@ -96,20 +137,6 @@ class _ReceiptViewState extends State { appBar: ProductsAppBar( title: 'Просмотр чека', actions: [ - // StoreConnector( - // converter: (store) => store.state.settingState!.printer!, - // builder: (context, snapshot) { - // final bool success = - // snapshot.device != null && printerLocked == false; - // return IconButton( - // onPressed: success ? print : null, - // icon: Icon( - // Icons.print, - // color: success ? textColor : placeholderColor, - // ), - // ); - // }, - // ) PopupMenuButton( onSelected: onSelectChoice, itemBuilder: (BuildContext context) { @@ -129,8 +156,7 @@ class _ReceiptViewState extends State { child: SingleChildScrollView( physics: const BouncingScrollPhysics(), child: Center( - child: - imageFromBase64String(widget.transactionData.sellResponse), + child: imageFromBase64String(transactionData.sellResponse), ), ), ) diff --git a/pubspec.lock b/pubspec.lock index 0c13f95..8783bfa 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,6 +1,13 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + url: "https://pub.dartlang.org" + source: hosted + version: "22.0.0" ai_barcode: dependency: "direct main" description: @@ -22,6 +29,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "3.0.0" + analyzer: + dependency: transitive + description: + name: analyzer + url: "https://pub.dartlang.org" + source: hosted + version: "1.7.2" archive: dependency: transitive description: @@ -29,6 +43,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "3.1.6" + args: + dependency: transitive + description: + name: args + url: "https://pub.dartlang.org" + source: hosted + version: "2.3.0" async: dependency: transitive description: @@ -50,6 +71,62 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.0" + build: + dependency: transitive + description: + name: build + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.1" + build_config: + dependency: transitive + description: + name: build_config + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + build_daemon: + dependency: transitive + description: + name: build_daemon + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.1" + build_resolvers: + dependency: transitive + description: + name: build_resolvers + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.4" + build_runner: + dependency: "direct dev" + description: + name: build_runner + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.5" + build_runner_core: + dependency: transitive + description: + name: build_runner_core + url: "https://pub.dartlang.org" + source: hosted + version: "7.2.2" + built_collection: + dependency: transitive + description: + name: built_collection + url: "https://pub.dartlang.org" + source: hosted + version: "5.1.1" + built_value: + dependency: transitive + description: + name: built_value + url: "https://pub.dartlang.org" + source: hosted + version: "8.1.3" characters: dependency: transitive description: @@ -71,6 +148,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.0" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" + cli_util: + dependency: transitive + description: + name: cli_util + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.5" clock: dependency: transitive description: @@ -78,6 +169,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.1.0" + code_builder: + dependency: transitive + description: + name: code_builder + url: "https://pub.dartlang.org" + source: hosted + version: "4.1.0" collection: dependency: transitive description: @@ -85,6 +183,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.15.0" + convert: + dependency: transitive + description: + name: convert + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.1" crypto: dependency: transitive description: @@ -106,6 +211,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.4" + dart_style: + dependency: transitive + description: + name: dart_style + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.1" device_info: dependency: "direct main" description: @@ -162,6 +274,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "6.1.2" + fixnum: + dependency: transitive + description: + name: fixnum + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" flutter: dependency: "direct main" description: flutter @@ -205,6 +324,13 @@ packages: description: flutter source: sdk version: "0.0.0" + frontend_server_client: + dependency: transitive + description: + name: frontend_server_client + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.2" gbk_codec: dependency: transitive description: @@ -219,6 +345,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "7.2.0" + glob: + dependency: transitive + description: + name: glob + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.2" + graphs: + dependency: transitive + description: + name: graphs + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" grouped_list: dependency: "direct main" description: @@ -247,6 +387,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.13.4" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.1" http_parser: dependency: transitive description: @@ -275,6 +422,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.17.0" + io: + dependency: transitive + description: + name: io + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.3" js: dependency: transitive description: @@ -288,7 +442,14 @@ packages: name: json_annotation url: "https://pub.dartlang.org" source: hosted - version: "4.3.0" + version: "4.1.0" + json_serializable: + dependency: "direct dev" + description: + name: json_serializable + url: "https://pub.dartlang.org" + source: hosted + version: "4.1.4" lint: dependency: "direct dev" description: @@ -310,6 +471,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.1.0" + logging: + dependency: transitive + description: + name: logging + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" mask_text_input_formatter: dependency: "direct main" description: @@ -345,6 +513,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.7.0" + mime: + dependency: transitive + description: + name: mime + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" nested: dependency: transitive description: @@ -352,6 +527,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.0" + package_config: + dependency: transitive + description: + name: package_config + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.2" path: dependency: transitive description: @@ -422,13 +604,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.4" + pedantic: + dependency: transitive + description: + name: pedantic + url: "https://pub.dartlang.org" + source: hosted + version: "1.11.1" permission_handler: dependency: "direct main" description: name: permission_handler url: "https://pub.dartlang.org" source: hosted - version: "8.2.6" + version: "8.3.0" permission_handler_platform_interface: dependency: transitive description: @@ -457,6 +646,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.2" + pool: + dependency: transitive + description: + name: pool + url: "https://pub.dartlang.org" + source: hosted + version: "1.5.0" process: dependency: transitive description: @@ -471,6 +667,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "6.0.1" + pub_semver: + dependency: transitive + description: + name: pub_semver + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + pubspec_parse: + dependency: transitive + description: + name: pubspec_parse + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" qr: dependency: transitive description: @@ -569,11 +779,32 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.3" + shelf: + dependency: transitive + description: + name: shelf + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" sky_engine: dependency: transitive description: flutter source: sdk version: "0.0.99" + source_gen: + dependency: transitive + description: + name: source_gen + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.3" source_span: dependency: transitive description: @@ -609,6 +840,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.0" + stream_transform: + dependency: transitive + description: + name: stream_transform + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" string_scanner: dependency: transitive description: @@ -637,6 +875,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.4.2" + timing: + dependency: transitive + description: + name: timing + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" typed_data: dependency: transitive description: @@ -721,6 +966,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.0" + watcher: + dependency: transitive + description: + name: watcher + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" win32: dependency: transitive description: @@ -742,6 +1001,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "5.3.1" + yaml: + dependency: transitive + description: + name: yaml + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.0" sdks: dart: ">=2.14.0 <3.0.0" flutter: ">=2.5.0" diff --git a/pubspec.yaml b/pubspec.yaml index 72e5b50..569dde5 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -18,7 +18,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: ">=2.12.0 <3.0.0" + sdk: ">=2.14.0 <3.0.0" dependencies: flutter: @@ -51,7 +51,7 @@ dependencies: uuid: ^3.0.5 charset_converter: ^2.0.0 ai_barcode: ^3.0.1 - permission_handler: ^8.2.6 + permission_handler: ^8.3.0 flutter_svg: ^0.23.0+1 grouped_list: ^4.1.0 flutter_bluetooth_basic: ^0.1.7 @@ -59,9 +59,11 @@ dependencies: esc_pos_utils: ^1.1.0 esc_pos_bluetooth: ^0.4.1 dev_dependencies: + build_runner: ^2.1.5 flutter_test: sdk: flutter lint: ^1.7.2 + json_serializable: ^4.1.2 # For information on the generic Dart part of this file, see the