Refactor
This commit is contained in:
parent
82bcd78e9f
commit
4bff8e1de8
|
|
@ -22,7 +22,7 @@ class AuthRepository {
|
||||||
'password': password,
|
'password': password,
|
||||||
};
|
};
|
||||||
|
|
||||||
final response = await webClient.post(url + '/login?include_static=true', '', json.encode(credentials));
|
final Future<dynamic> response = await webClient.post(url + '/login?include_static=true', '', json.encode(credentials));
|
||||||
print(response);
|
print(response);
|
||||||
LoginResponse loginResponse = serializers.deserializeWith(
|
LoginResponse loginResponse = serializers.deserializeWith(
|
||||||
LoginResponse.serializer, response);
|
LoginResponse.serializer, response);
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ class ClientRepository {
|
||||||
|
|
||||||
Future<BuiltList<ClientEntity>> loadList(CompanyEntity company, AuthState auth) async {
|
Future<BuiltList<ClientEntity>> loadList(CompanyEntity company, AuthState auth) async {
|
||||||
|
|
||||||
final response = await webClient.get(
|
final Future<dynamic> response = await webClient.get(
|
||||||
auth.url + '/clients', company.token);
|
auth.url + '/clients', company.token);
|
||||||
|
|
||||||
ClientListResponse clientResponse = serializers.deserializeWith(
|
ClientListResponse clientResponse = serializers.deserializeWith(
|
||||||
|
|
@ -29,7 +29,7 @@ class ClientRepository {
|
||||||
Future saveData(CompanyEntity company, AuthState auth, ClientEntity client, [EntityAction action]) async {
|
Future saveData(CompanyEntity company, AuthState auth, ClientEntity client, [EntityAction action]) async {
|
||||||
|
|
||||||
var data = serializers.serializeWith(ClientEntity.serializer, client);
|
var data = serializers.serializeWith(ClientEntity.serializer, client);
|
||||||
var response;
|
Future<dynamic> response;
|
||||||
|
|
||||||
if (client.isNew) {
|
if (client.isNew) {
|
||||||
response = await webClient.post(
|
response = await webClient.post(
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ class CreditsRepository {
|
||||||
|
|
||||||
Future<BuiltList<CreditEntity>> loadList(CompanyEntity company, AuthState auth) async {
|
Future<BuiltList<CreditEntity>> loadList(CompanyEntity company, AuthState auth) async {
|
||||||
|
|
||||||
final response = await webClient.get(
|
final Future<dynamic> response = await webClient.get(
|
||||||
auth.url + '/credits?per_page=500', company.token);
|
auth.url + '/credits?per_page=500', company.token);
|
||||||
|
|
||||||
CreditListResponse creditResponse = serializers.deserializeWith(
|
CreditListResponse creditResponse = serializers.deserializeWith(
|
||||||
|
|
@ -29,7 +29,7 @@ class CreditsRepository {
|
||||||
Future saveData(CompanyEntity company, AuthState auth, CreditEntity credit, [EntityAction action]) async {
|
Future saveData(CompanyEntity company, AuthState auth, CreditEntity credit, [EntityAction action]) async {
|
||||||
|
|
||||||
var data = serializers.serializeWith(CreditEntity.serializer, credit);
|
var data = serializers.serializeWith(CreditEntity.serializer, credit);
|
||||||
var response;
|
Future<dynamic> response;
|
||||||
|
|
||||||
if (credit.isNew) {
|
if (credit.isNew) {
|
||||||
response = await webClient.post(
|
response = await webClient.post(
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ class DashboardRepository {
|
||||||
|
|
||||||
Future<DashboardEntity> loadItem(CompanyEntity company, AuthState auth) async {
|
Future<DashboardEntity> loadItem(CompanyEntity company, AuthState auth) async {
|
||||||
|
|
||||||
final response = await webClient.get(
|
final Future<dynamic> response = await webClient.get(
|
||||||
auth.url + '/dashboard', company.token);
|
auth.url + '/dashboard', company.token);
|
||||||
|
|
||||||
DashboardResponse dashboardResponse = serializers.deserializeWith(
|
DashboardResponse dashboardResponse = serializers.deserializeWith(
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ class ExpenseRepository {
|
||||||
|
|
||||||
Future<BuiltList<ExpenseEntity>> loadList(CompanyEntity company, AuthState auth) async {
|
Future<BuiltList<ExpenseEntity>> loadList(CompanyEntity company, AuthState auth) async {
|
||||||
|
|
||||||
final response = await webClient.get(
|
final Future<dynamic> response = await webClient.get(
|
||||||
auth.url + '/expenses?per_page=500', company.token);
|
auth.url + '/expenses?per_page=500', company.token);
|
||||||
|
|
||||||
ExpenseListResponse expenseResponse = serializers.deserializeWith(
|
ExpenseListResponse expenseResponse = serializers.deserializeWith(
|
||||||
|
|
@ -29,7 +29,7 @@ class ExpenseRepository {
|
||||||
Future saveData(CompanyEntity company, AuthState auth, ExpenseEntity expense, [EntityAction action]) async {
|
Future saveData(CompanyEntity company, AuthState auth, ExpenseEntity expense, [EntityAction action]) async {
|
||||||
|
|
||||||
var data = serializers.serializeWith(ExpenseEntity.serializer, expense);
|
var data = serializers.serializeWith(ExpenseEntity.serializer, expense);
|
||||||
var response;
|
Future<dynamic> response;
|
||||||
|
|
||||||
if (expense.isNew) {
|
if (expense.isNew) {
|
||||||
response = await webClient.post(
|
response = await webClient.post(
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ class InvoiceRepository {
|
||||||
|
|
||||||
Future<BuiltList<InvoiceEntity>> loadList(CompanyEntity company, AuthState auth) async {
|
Future<BuiltList<InvoiceEntity>> loadList(CompanyEntity company, AuthState auth) async {
|
||||||
|
|
||||||
final response = await webClient.get(
|
final Future<dynamic> response = await webClient.get(
|
||||||
auth.url + '/invoices?include=invitations', company.token);
|
auth.url + '/invoices?include=invitations', company.token);
|
||||||
|
|
||||||
InvoiceListResponse invoiceResponse = serializers.deserializeWith(
|
InvoiceListResponse invoiceResponse = serializers.deserializeWith(
|
||||||
|
|
@ -29,7 +29,7 @@ class InvoiceRepository {
|
||||||
Future saveData(CompanyEntity company, AuthState auth, InvoiceEntity invoice, [EntityAction action]) async {
|
Future saveData(CompanyEntity company, AuthState auth, InvoiceEntity invoice, [EntityAction action]) async {
|
||||||
|
|
||||||
var data = serializers.serializeWith(InvoiceEntity.serializer, invoice);
|
var data = serializers.serializeWith(InvoiceEntity.serializer, invoice);
|
||||||
var response;
|
Future<dynamic> response;
|
||||||
|
|
||||||
if (invoice.isNew) {
|
if (invoice.isNew) {
|
||||||
response = await webClient.post(
|
response = await webClient.post(
|
||||||
|
|
@ -50,7 +50,7 @@ class InvoiceRepository {
|
||||||
|
|
||||||
Future emailInvoice(CompanyEntity company, AuthState auth, InvoiceEntity invoice) async {
|
Future emailInvoice(CompanyEntity company, AuthState auth, InvoiceEntity invoice) async {
|
||||||
|
|
||||||
var response = await webClient.post(
|
final Future<dynamic> response = await webClient.post(
|
||||||
auth.url + '/email_invoice?invoice_id=${invoice.id}', company.token, null);
|
auth.url + '/email_invoice?invoice_id=${invoice.id}', company.token, null);
|
||||||
|
|
||||||
InvoiceItemResponse invoiceResponse = serializers.deserializeWith(
|
InvoiceItemResponse invoiceResponse = serializers.deserializeWith(
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ class PaymentsRepository {
|
||||||
|
|
||||||
Future<BuiltList<PaymentEntity>> loadList(CompanyEntity company, AuthState auth) async {
|
Future<BuiltList<PaymentEntity>> loadList(CompanyEntity company, AuthState auth) async {
|
||||||
|
|
||||||
final response = await webClient.get(
|
final Future<dynamic> response = await webClient.get(
|
||||||
auth.url + '/payments?per_page=500', company.token);
|
auth.url + '/payments?per_page=500', company.token);
|
||||||
|
|
||||||
PaymentListResponse paymentResponse = serializers.deserializeWith(
|
PaymentListResponse paymentResponse = serializers.deserializeWith(
|
||||||
|
|
@ -29,7 +29,7 @@ class PaymentsRepository {
|
||||||
Future saveData(CompanyEntity company, AuthState auth, PaymentEntity payment, [EntityAction action]) async {
|
Future saveData(CompanyEntity company, AuthState auth, PaymentEntity payment, [EntityAction action]) async {
|
||||||
|
|
||||||
var data = serializers.serializeWith(PaymentEntity.serializer, payment);
|
var data = serializers.serializeWith(PaymentEntity.serializer, payment);
|
||||||
var response;
|
Future<dynamic> response;
|
||||||
|
|
||||||
if (payment.isNew) {
|
if (payment.isNew) {
|
||||||
response = await webClient.post(
|
response = await webClient.post(
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ class ProductRepository {
|
||||||
|
|
||||||
Future<BuiltList<ProductEntity>> loadList(CompanyEntity company, AuthState auth) async {
|
Future<BuiltList<ProductEntity>> loadList(CompanyEntity company, AuthState auth) async {
|
||||||
|
|
||||||
final response = await webClient.get(
|
final Future<dynamic> response = await webClient.get(
|
||||||
auth.url + '/products', company.token);
|
auth.url + '/products', company.token);
|
||||||
|
|
||||||
ProductListResponse productResponse = serializers.deserializeWith(
|
ProductListResponse productResponse = serializers.deserializeWith(
|
||||||
|
|
@ -29,7 +29,7 @@ class ProductRepository {
|
||||||
Future saveData(CompanyEntity company, AuthState auth, ProductEntity product, [EntityAction action]) async {
|
Future saveData(CompanyEntity company, AuthState auth, ProductEntity product, [EntityAction action]) async {
|
||||||
|
|
||||||
var data = serializers.serializeWith(ProductEntity.serializer, product);
|
var data = serializers.serializeWith(ProductEntity.serializer, product);
|
||||||
var response;
|
Future<dynamic> response;
|
||||||
|
|
||||||
if (product.isNew) {
|
if (product.isNew) {
|
||||||
response = await webClient.post(
|
response = await webClient.post(
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ class ProjectsRepository {
|
||||||
|
|
||||||
Future<BuiltList<ProjectEntity>> loadList(CompanyEntity company, AuthState auth) async {
|
Future<BuiltList<ProjectEntity>> loadList(CompanyEntity company, AuthState auth) async {
|
||||||
|
|
||||||
final response = await webClient.get(
|
final Future<dynamic> response = await webClient.get(
|
||||||
auth.url + '/projects?per_page=500', company.token);
|
auth.url + '/projects?per_page=500', company.token);
|
||||||
|
|
||||||
ProjectListResponse projectResponse = serializers.deserializeWith(
|
ProjectListResponse projectResponse = serializers.deserializeWith(
|
||||||
|
|
@ -29,7 +29,7 @@ class ProjectsRepository {
|
||||||
Future saveData(CompanyEntity company, AuthState auth, ProjectEntity project, [EntityAction action]) async {
|
Future saveData(CompanyEntity company, AuthState auth, ProjectEntity project, [EntityAction action]) async {
|
||||||
|
|
||||||
var data = serializers.serializeWith(ProjectEntity.serializer, project);
|
var data = serializers.serializeWith(ProjectEntity.serializer, project);
|
||||||
var response;
|
Future<dynamic> response;
|
||||||
|
|
||||||
if (project.isNew) {
|
if (project.isNew) {
|
||||||
response = await webClient.post(
|
response = await webClient.post(
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ class StaticRepository {
|
||||||
|
|
||||||
Future<StaticDataEntity> loadList(CompanyEntity company, AuthState auth) async {
|
Future<StaticDataEntity> loadList(CompanyEntity company, AuthState auth) async {
|
||||||
|
|
||||||
final response = await webClient.get(
|
final Future<dynamic> response = await webClient.get(
|
||||||
auth.url + '/static', company.token);
|
auth.url + '/static', company.token);
|
||||||
|
|
||||||
StaticDataItemResponse staticDataResponse = serializers.deserializeWith(
|
StaticDataItemResponse staticDataResponse = serializers.deserializeWith(
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ class TasksRepository {
|
||||||
|
|
||||||
Future<BuiltList<TaskEntity>> loadList(CompanyEntity company, AuthState auth) async {
|
Future<BuiltList<TaskEntity>> loadList(CompanyEntity company, AuthState auth) async {
|
||||||
|
|
||||||
final response = await webClient.get(
|
final Future<dynamic> response = await webClient.get(
|
||||||
auth.url + '/tasks?per_page=500', company.token);
|
auth.url + '/tasks?per_page=500', company.token);
|
||||||
|
|
||||||
TaskListResponse taskResponse = serializers.deserializeWith(
|
TaskListResponse taskResponse = serializers.deserializeWith(
|
||||||
|
|
@ -29,7 +29,7 @@ class TasksRepository {
|
||||||
Future saveData(CompanyEntity company, AuthState auth, TaskEntity task, [EntityAction action]) async {
|
Future saveData(CompanyEntity company, AuthState auth, TaskEntity task, [EntityAction action]) async {
|
||||||
|
|
||||||
var data = serializers.serializeWith(TaskEntity.serializer, task);
|
var data = serializers.serializeWith(TaskEntity.serializer, task);
|
||||||
var response;
|
Future<dynamic> response;
|
||||||
|
|
||||||
if (task.isNew) {
|
if (task.isNew) {
|
||||||
response = await webClient.post(
|
response = await webClient.post(
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ class VendorRepository {
|
||||||
|
|
||||||
Future<BuiltList<VendorEntity>> loadList(CompanyEntity company, AuthState auth) async {
|
Future<BuiltList<VendorEntity>> loadList(CompanyEntity company, AuthState auth) async {
|
||||||
|
|
||||||
final response = await webClient.get(
|
final Future<dynamic> response = await webClient.get(
|
||||||
auth.url + '/vendors?per_page=500', company.token);
|
auth.url + '/vendors?per_page=500', company.token);
|
||||||
|
|
||||||
VendorListResponse vendorResponse = serializers.deserializeWith(
|
VendorListResponse vendorResponse = serializers.deserializeWith(
|
||||||
|
|
@ -29,7 +29,7 @@ class VendorRepository {
|
||||||
Future saveData(CompanyEntity company, AuthState auth, VendorEntity vendor, [EntityAction action]) async {
|
Future saveData(CompanyEntity company, AuthState auth, VendorEntity vendor, [EntityAction action]) async {
|
||||||
|
|
||||||
var data = serializers.serializeWith(VendorEntity.serializer, vendor);
|
var data = serializers.serializeWith(VendorEntity.serializer, vendor);
|
||||||
var response;
|
Future<dynamic> response;
|
||||||
|
|
||||||
if (vendor.isNew) {
|
if (vendor.isNew) {
|
||||||
response = await webClient.post(
|
response = await webClient.post(
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ class WebClient {
|
||||||
throw _parseError(response.body);
|
throw _parseError(response.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
final jsonResponse = json.decode(response.body);
|
final dynamic jsonResponse = json.decode(response.body);
|
||||||
|
|
||||||
//print(jsonResponse);
|
//print(jsonResponse);
|
||||||
|
|
||||||
|
|
@ -59,7 +59,7 @@ class WebClient {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final jsonResponse = json.decode(response.body);
|
final dynamic jsonResponse = json.decode(response.body);
|
||||||
return jsonResponse;
|
return jsonResponse;
|
||||||
} catch (exception) {
|
} catch (exception) {
|
||||||
print(response.body);
|
print(response.body);
|
||||||
|
|
@ -82,7 +82,7 @@ class WebClient {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final jsonResponse = json.decode(response.body);
|
final dynamic jsonResponse = json.decode(response.body);
|
||||||
return jsonResponse;
|
return jsonResponse;
|
||||||
} catch (exception) {
|
} catch (exception) {
|
||||||
print(response.body);
|
print(response.body);
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ void main() {
|
||||||
..addAll(createStoreInvoicesMiddleware())
|
..addAll(createStoreInvoicesMiddleware())
|
||||||
..addAll(createStorePersistenceMiddleware())
|
..addAll(createStorePersistenceMiddleware())
|
||||||
..addAll([
|
..addAll([
|
||||||
LoggingMiddleware.printer(),
|
LoggingMiddleware<dynamic>.printer(),
|
||||||
]));
|
]));
|
||||||
|
|
||||||
runApp(InvoiceNinjaApp(store: store));
|
runApp(InvoiceNinjaApp(store: store));
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ class _AppBottomBarState extends State<AppBottomBar> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_filterController = Scaffold.of(context).showBottomSheet((context) {
|
_filterController = Scaffold.of(context).showBottomSheet<StoreConnector>((context) {
|
||||||
return StoreConnector<AppState, BuiltList<EntityState>>(
|
return StoreConnector<AppState, BuiltList<EntityState>>(
|
||||||
//distinct: true,
|
//distinct: true,
|
||||||
converter: (Store<AppState> store) => store.state.getListState(widget.entityType).stateFilters,
|
converter: (Store<AppState> store) => store.state.getListState(widget.entityType).stateFilters,
|
||||||
|
|
@ -95,7 +95,7 @@ class _AppBottomBarState extends State<AppBottomBar> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_sortController = Scaffold.of(context).showBottomSheet((context) {
|
_sortController = Scaffold.of(context).showBottomSheet<StoreConnector>((context) {
|
||||||
return StoreConnector<AppState, ListUIState>(
|
return StoreConnector<AppState, ListUIState>(
|
||||||
//distinct: true,
|
//distinct: true,
|
||||||
converter: (Store<AppState> store) => store.state.getListState(widget.entityType),
|
converter: (Store<AppState> store) => store.state.getListState(widget.entityType),
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,7 @@ class _EntityDropdownState extends State<EntityDropdown> {
|
||||||
}).toList());
|
}).toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
showDialog(
|
showDialog<Padding>(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
return Padding(
|
return Padding(
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ class DatePicker extends StatefulWidget {
|
||||||
@required this.labelText,
|
@required this.labelText,
|
||||||
@required this.onSelected,
|
@required this.onSelected,
|
||||||
@required this.selectedDate,
|
@required this.selectedDate,
|
||||||
@required this.validator,
|
this.validator,
|
||||||
});
|
});
|
||||||
|
|
||||||
final String labelText;
|
final String labelText;
|
||||||
|
|
|
||||||
|
|
@ -116,7 +116,7 @@ class ContactEditDetailsState extends State<ContactEditDetails> {
|
||||||
var localization = AppLocalization.of(context);
|
var localization = AppLocalization.of(context);
|
||||||
|
|
||||||
_confirmDelete() {
|
_confirmDelete() {
|
||||||
showDialog(
|
showDialog<AlertDialog>(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) => AlertDialog(
|
builder: (BuildContext context) => AlertDialog(
|
||||||
semanticLabel: localization.areYouSure,
|
semanticLabel: localization.areYouSure,
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@ class ClientEditVM {
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
Navigator
|
Navigator
|
||||||
.of(context)
|
.of(context)
|
||||||
.push(MaterialPageRoute(builder: (_) => ClientViewScreen()));
|
.push<ClientViewScreen>(MaterialPageRoute(builder: (_) => ClientViewScreen()));
|
||||||
} else {
|
} else {
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ class _ClientViewState extends State<ClientView>
|
||||||
floatingActionButton: FloatingActionButton(
|
floatingActionButton: FloatingActionButton(
|
||||||
backgroundColor: Theme.of(context).primaryColorDark,
|
backgroundColor: Theme.of(context).primaryColorDark,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
showDialog(
|
showDialog<SimpleDialog>(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) =>
|
builder: (BuildContext context) =>
|
||||||
SimpleDialog(children: <Widget>[
|
SimpleDialog(children: <Widget>[
|
||||||
|
|
|
||||||
|
|
@ -120,7 +120,7 @@ class ItemEditDetailsState extends State<ItemEditDetails> with AutomaticKeepAliv
|
||||||
var localization = AppLocalization.of(context);
|
var localization = AppLocalization.of(context);
|
||||||
|
|
||||||
_confirmDelete() {
|
_confirmDelete() {
|
||||||
showDialog(
|
showDialog<AlertDialog>(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) => AlertDialog(
|
builder: (BuildContext context) => AlertDialog(
|
||||||
semanticLabel: localization.areYouSure,
|
semanticLabel: localization.areYouSure,
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ class InvoiceEditVM {
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
Navigator
|
Navigator
|
||||||
.of(context)
|
.of(context)
|
||||||
.push(MaterialPageRoute(builder: (_) => InvoiceViewScreen()));
|
.push<InvoiceViewScreen>(MaterialPageRoute(builder: (_) => InvoiceViewScreen()));
|
||||||
} else {
|
} else {
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -63,8 +63,8 @@ class InvoiceViewVM {
|
||||||
|
|
||||||
Future<Null> _viewPdf(BuildContext context) async {
|
Future<Null> _viewPdf(BuildContext context) async {
|
||||||
var localization = AppLocalization.of(context);
|
var localization = AppLocalization.of(context);
|
||||||
var url;
|
String url;
|
||||||
var useWebView;
|
bool useWebView;
|
||||||
|
|
||||||
if (Theme.of(context).platform == TargetPlatform.iOS) {
|
if (Theme.of(context).platform == TargetPlatform.iOS) {
|
||||||
url = invoice.invitationSilentLink;
|
url = invoice.invitationSilentLink;
|
||||||
|
|
@ -96,7 +96,7 @@ class InvoiceViewVM {
|
||||||
},
|
},
|
||||||
onActionSelected: (BuildContext context, EntityAction action) {
|
onActionSelected: (BuildContext context, EntityAction action) {
|
||||||
final Completer<Null> completer = new Completer<Null>();
|
final Completer<Null> completer = new Completer<Null>();
|
||||||
var message;
|
String message;
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case EntityAction.pdf:
|
case EntityAction.pdf:
|
||||||
_viewPdf(context);
|
_viewPdf(context);
|
||||||
|
|
|
||||||
|
|
@ -36,8 +36,8 @@ String formatNumber(
|
||||||
ClientEntity client = state.selectedCompanyState.clientState.map[clientId];
|
ClientEntity client = state.selectedCompanyState.clientState.map[clientId];
|
||||||
|
|
||||||
//var countryId = client?.countryId ?? company.countryId;
|
//var countryId = client?.countryId ?? company.countryId;
|
||||||
var currencyId;
|
int currencyId;
|
||||||
var countryId = client?.countryId ?? 1;
|
int countryId = client?.countryId ?? 1;
|
||||||
|
|
||||||
if (client != null && client.currencyId > 0) {
|
if (client != null && client.currencyId > 0) {
|
||||||
currencyId = client.currencyId;
|
currencyId = client.currencyId;
|
||||||
|
|
@ -73,7 +73,7 @@ String formatNumber(
|
||||||
MINUS_SIGN: '-',
|
MINUS_SIGN: '-',
|
||||||
);
|
);
|
||||||
|
|
||||||
var formatter;
|
NumberFormat formatter;
|
||||||
String formatted;
|
String formatted;
|
||||||
|
|
||||||
if (formatNumberType == FormatNumberType.int) {
|
if (formatNumberType == FormatNumberType.int) {
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ AppState reducer(AppState state, dynamic action) {
|
||||||
void main() {
|
void main() {
|
||||||
final store =
|
final store =
|
||||||
Store<AppState>(reducer, initialState: AppState.init(), middleware: [
|
Store<AppState>(reducer, initialState: AppState.init(), middleware: [
|
||||||
LoggingMiddleware.printer(),
|
LoggingMiddleware<dynamic>.printer(),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
runApp(MyApp(store: store));
|
runApp(MyApp(store: store));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue