diff --git a/lib/ui/client/edit/client_edit_contacts.dart b/lib/ui/client/edit/client_edit_contacts.dart index 906d4219e..e8e74f5de 100644 --- a/lib/ui/client/edit/client_edit_contacts.dart +++ b/lib/ui/client/edit/client_edit_contacts.dart @@ -33,9 +33,6 @@ class ClientEditContactsState extends State contactKeys = client.contacts .map((contact) => GlobalKey()) .toList(); - - // Add initial blank contact - _onAddPressed(); } List getContacts() { @@ -47,12 +44,15 @@ class ClientEditContactsState extends State } _onAddPressed() { - print('onAddPressed..'); setState(() { contacts.add(ContactEntity()); contactKeys.add(GlobalKey()); }); } + + _onRemovePressed() { + + } @override Widget build(BuildContext context) { @@ -60,20 +60,26 @@ class ClientEditContactsState extends State List items = []; - for (var i=0; i ContactEditDetailsState(); @@ -106,24 +114,32 @@ class ContactEditDetailsState extends State { return Padding( padding: const EdgeInsets.only(bottom: 8.0), - child: Card( - elevation: 2.0, - child: Padding( - padding: const EdgeInsets.only( - left: 12.0, right: 12.0, top: 12.0, bottom: 18.0), - child: Column( - children: [ - TextFormField( - autocorrect: false, - initialValue: widget.contact.firstName, - onSaved: (value) => _firstName = value.trim(), - decoration: InputDecoration( - labelText: localization.firstName, - ), - ), - ], + child: Stack( + children: [ + IconButton( + icon: Icon(Icons.close), + onPressed: widget.onRemovePressed, ), - ), + Card( + elevation: 2.0, + child: Padding( + padding: const EdgeInsets.only( + left: 12.0, right: 12.0, top: 12.0, bottom: 18.0), + child: Column( + children: [ + TextFormField( + autocorrect: false, + initialValue: widget.contact.firstName, + onSaved: (value) => _firstName = value.trim(), + decoration: InputDecoration( + labelText: localization.firstName, + ), + ), + ], + ), + ), + ) + ], ), ); } diff --git a/lib/utils/localization.dart b/lib/utils/localization.dart index 4d8963a3f..653162c8d 100644 --- a/lib/utils/localization.dart +++ b/lib/utils/localization.dart @@ -63,7 +63,7 @@ class AppLocalization { 'additional': 'Additional', 'first_name': 'First Name', 'last_name': 'Last Name', - 'add': 'Add', + 'add_contact': 'Add Contact', 'product': 'Product', 'products': 'Products', @@ -149,7 +149,7 @@ class AppLocalization { String get additional => _localizedValues[locale.languageCode]['additional']; String get firstName => _localizedValues[locale.languageCode]['first_name']; String get lastName => _localizedValues[locale.languageCode]['last_name']; - String get add => _localizedValues[locale.languageCode]['add']; + String get addContact => _localizedValues[locale.languageCode]['add_contact']; String get product => _localizedValues[locale.languageCode]['product']; String get products => _localizedValues[locale.languageCode]['products'];