ios permissions

This commit is contained in:
Hillel Coren 2022-01-16 21:07:43 +02:00
parent 159e82811a
commit 755e73d63a
3 changed files with 442 additions and 438 deletions

View File

@ -295,7 +295,8 @@ class _LoginState extends State<LoginView> {
final double horizontalPadding = final double horizontalPadding =
calculateLayout(context) == AppLayout.desktop ? 40 : 16; calculateLayout(context) == AppLayout.desktop ? 40 : 16;
return ScrollableListView( return SafeArea(
child: ScrollableListView(
children: <Widget>[ children: <Widget>[
if (isDesktopOS()) if (isDesktopOS())
AppTitleBar() AppTitleBar()
@ -738,6 +739,7 @@ class _LoginState extends State<LoginView> {
), ),
), ),
], ],
),
); );
} }
} }

View File

@ -11,6 +11,7 @@ import 'package:contacts_service/contacts_service.dart';
// Project imports: // Project imports:
import 'package:invoiceninja_flutter/constants.dart'; import 'package:invoiceninja_flutter/constants.dart';
import 'package:invoiceninja_flutter/data/models/entities.dart'; import 'package:invoiceninja_flutter/data/models/entities.dart';
import 'package:invoiceninja_flutter/data/models/models.dart';
import 'package:invoiceninja_flutter/redux/static/static_selectors.dart'; import 'package:invoiceninja_flutter/redux/static/static_selectors.dart';
import 'package:invoiceninja_flutter/ui/app/form_card.dart'; import 'package:invoiceninja_flutter/ui/app/form_card.dart';
import 'package:invoiceninja_flutter/ui/app/forms/custom_field.dart'; import 'package:invoiceninja_flutter/ui/app/forms/custom_field.dart';
@ -131,24 +132,24 @@ class ClientEditDetailsState extends State<ClientEditDetails> {
String countryId; String countryId;
countryMap.keys.forEach((countryId) { countryMap.keys.forEach((countryId) {
final country = countryMap[countryId]; final country = countryMap[countryId] ?? CountryEntity();
if (country.name.toLowerCase() == contactAddress.country.toLowerCase()) { if (country.name.toLowerCase() == contactAddress?.country?.toLowerCase()) {
countryId = country.id; countryId = country.id;
} }
}); });
widget.viewModel.onChanged(client.rebuild((b) => b widget.viewModel.onChanged(client.rebuild((b) => b
..name = contact.company ?? '' ..name = (contact?.company ?? '').trim()
..address1 = contactAddress.street ?? '' ..address1 = (contactAddress?.street ?? '').trim()
..city = contactAddress.city ?? '' ..city = (contactAddress?.city ?? '').trim()
..state = contactAddress.region ?? '' ..state = (contactAddress?.region ?? '').trim()
..postalCode = contactAddress.postcode ?? '' ..postalCode = (contactAddress?.postcode ?? '').trim()
..countryId = countryId ..countryId = countryId ?? ''
..contacts[0] = client.contacts[0].rebuild((b) => b ..contacts[0] = client.contacts[0].rebuild((b) => b
..firstName = contact.givenName ?? '' ..firstName = (contact?.givenName ?? '').trim()
..lastName = contact.familyName ?? '' ..lastName = (contact?.familyName ?? '').trim()
..email = contactEmail.value ?? '' ..email = (contactEmail?.value ?? '').trim()
..phone = contactPhone.value ?? '') ..phone = (contactPhone?.value ?? '').trim())
..updatedAt = DateTime.now().millisecondsSinceEpoch)); ..updatedAt = DateTime.now().millisecondsSinceEpoch));
} }

View File

@ -11,6 +11,7 @@ import 'package:contacts_service/contacts_service.dart';
// Project imports: // Project imports:
import 'package:invoiceninja_flutter/constants.dart'; import 'package:invoiceninja_flutter/constants.dart';
import 'package:invoiceninja_flutter/data/models/entities.dart'; import 'package:invoiceninja_flutter/data/models/entities.dart';
import 'package:invoiceninja_flutter/data/models/models.dart';
import 'package:invoiceninja_flutter/ui/app/form_card.dart'; import 'package:invoiceninja_flutter/ui/app/form_card.dart';
import 'package:invoiceninja_flutter/ui/app/forms/custom_field.dart'; import 'package:invoiceninja_flutter/ui/app/forms/custom_field.dart';
import 'package:invoiceninja_flutter/ui/app/forms/decorated_form_field.dart'; import 'package:invoiceninja_flutter/ui/app/forms/decorated_form_field.dart';
@ -129,24 +130,24 @@ class VendorEditDetailsState extends State<VendorEditDetails> {
String countryId; String countryId;
countryMap.keys.forEach((countryId) { countryMap.keys.forEach((countryId) {
final country = countryMap[countryId]; final country = countryMap[countryId] ?? CountryEntity();
if (country.name.toLowerCase() == contactAddress.country.toLowerCase()) { if (country.name.toLowerCase() == contactAddress?.country?.toLowerCase()) {
countryId = country.id; countryId = country.id;
} }
}); });
widget.viewModel.onChanged(vendor.rebuild((b) => b widget.viewModel.onChanged(vendor.rebuild((b) => b
..name = contact.company ?? '' ..name = (contact?.company ?? '').trim()
..address1 = contactAddress.street ?? '' ..address1 = (contactAddress?.street ?? '').trim()
..city = contactAddress.city ?? '' ..city = (contactAddress?.city ?? '').trim()
..state = contactAddress.region ?? '' ..state = (contactAddress?.region ?? '').trim()
..postalCode = contactAddress.postcode ?? '' ..postalCode = (contactAddress?.postcode ?? '').trim()
..countryId = countryId ..countryId = countryId ?? ''
..contacts[0] = vendor.contacts[0].rebuild((b) => b ..contacts[0] = vendor.contacts[0].rebuild((b) => b
..firstName = contact.givenName ?? '' ..firstName = (contact?.givenName ?? '').trim()
..lastName = contact.familyName ?? '' ..lastName = (contact?.familyName ?? '').trim()
..email = contactEmail.value ?? '' ..email = (contactEmail?.value ?? '').trim()
..phone = contactPhone.value ?? '') ..phone = (contactPhone?.value ?? '').trim())
..updatedAt = DateTime.now().millisecondsSinceEpoch)); ..updatedAt = DateTime.now().millisecondsSinceEpoch));
} }