From 6da2f6c2a0a8e6be31348f8bffeca21e2316b24d Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 25 Mar 2020 22:35:02 +0200 Subject: [PATCH] Fix line item bug --- lib/ui/app/entity_dropdown.dart | 3 +++ lib/ui/invoice/edit/invoice_edit_items_desktop.dart | 8 ++++++-- lib/ui/settings/custom_fields.dart | 1 - 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/ui/app/entity_dropdown.dart b/lib/ui/app/entity_dropdown.dart index b540e4a2b..59d7c0133 100644 --- a/lib/ui/app/entity_dropdown.dart +++ b/lib/ui/app/entity_dropdown.dart @@ -149,6 +149,9 @@ class _EntityDropdownState extends State { ), ), onPointerDown: (_) { + if (!kIsWeb) { + return; + } final entity = _entityMap[entityId]; _textController.text = _entityMap[entityId].listDisplayName; widget.onSelected(entity); diff --git a/lib/ui/invoice/edit/invoice_edit_items_desktop.dart b/lib/ui/invoice/edit/invoice_edit_items_desktop.dart index 90faffe22..07fb0c209 100644 --- a/lib/ui/invoice/edit/invoice_edit_items_desktop.dart +++ b/lib/ui/invoice/edit/invoice_edit_items_desktop.dart @@ -1,3 +1,4 @@ +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_typeahead/flutter_typeahead.dart'; import 'package:invoiceninja_flutter/constants.dart'; @@ -154,11 +155,14 @@ class _InvoiceEditItemsDesktopState extends State { child: Container( color: Theme.of(context).cardColor, child: ListTile( - title: Text( - productState.map[suggestion].productKey), + title: + Text(productState.map[suggestion].productKey), ), ), onPointerDown: (_) { + if (!kIsWeb) { + return; + } final item = lineItems[index]; final product = productState.map[suggestion]; final updatedItem = item.rebuild((b) => b diff --git a/lib/ui/settings/custom_fields.dart b/lib/ui/settings/custom_fields.dart index a0a5b8871..bd54bab30 100644 --- a/lib/ui/settings/custom_fields.dart +++ b/lib/ui/settings/custom_fields.dart @@ -10,7 +10,6 @@ import 'package:invoiceninja_flutter/ui/settings/custom_fields_vm.dart'; import 'package:invoiceninja_flutter/ui/app/edit_scaffold.dart'; import 'package:invoiceninja_flutter/utils/completers.dart'; import 'package:invoiceninja_flutter/utils/localization.dart'; -import 'package:invoiceninja_flutter/utils/platforms.dart'; class CustomFields extends StatefulWidget { const CustomFields({