Clean up warnings
This commit is contained in:
parent
0162bd14bb
commit
d28683d249
|
|
@ -137,16 +137,16 @@ abstract class DesignEntity extends Object
|
|||
|
||||
int compareTo(DesignEntity design, String sortField, bool sortAscending) {
|
||||
int response = 0;
|
||||
DesignEntity designA = sortAscending ? this : design;
|
||||
DesignEntity designB = sortAscending ? design : this;
|
||||
final designA = sortAscending ? this : design;
|
||||
final designB = sortAscending ? design : this;
|
||||
|
||||
switch (sortField) {
|
||||
// STARTER: sort switch - do not remove comment
|
||||
case DesignFields.updatedAt:
|
||||
response = designA.updatedAt.compareTo(designB.updatedAt);
|
||||
}
|
||||
|
||||
if (response == 0) {
|
||||
// STARTER: sort default - do not remove comment
|
||||
return 0;
|
||||
return designA.name.toLowerCase().compareTo(designB.name.toLowerCase());
|
||||
} else {
|
||||
return response;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -179,6 +179,7 @@ abstract class InvoiceEntity extends Object
|
|||
@BuiltValueField(wireName: 'number')
|
||||
String get number;
|
||||
|
||||
@override
|
||||
double get discount;
|
||||
|
||||
@BuiltValueField(wireName: 'po_number')
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ class CreditRepository {
|
|||
credentials.url + '/credits?', credentials.token,
|
||||
data: json.encode(data));
|
||||
} else {
|
||||
var url = '${credentials.url}/credits/${credit.id}';
|
||||
final url = '${credentials.url}/credits/${credit.id}';
|
||||
response =
|
||||
await webClient.put(url, credentials.token, data: json.encode(data));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ class DesignRepository {
|
|||
credentials.url + '/designs', credentials.token,
|
||||
data: json.encode(data));
|
||||
} else {
|
||||
var url = credentials.url + '/designs/${design.id}';
|
||||
final url = credentials.url + '/designs/${design.id}';
|
||||
response =
|
||||
await webClient.put(url, credentials.token, data: json.encode(data));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,13 +82,10 @@ class PaymentRepository {
|
|||
final data = serializers.serializeWith(PaymentEntity.serializer, payment);
|
||||
dynamic response;
|
||||
|
||||
var url = credentials.url + '/payments/refund';
|
||||
//var url = credentials.url + '/payments/refund?include=paymentables';
|
||||
/*
|
||||
var url = credentials.url + '/payments/refund?include=paymentables';
|
||||
if (sendEmail) {
|
||||
url += '&email_receipt=true';
|
||||
}
|
||||
*/
|
||||
response =
|
||||
await webClient.post(url, credentials.token, data: json.encode(data));
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import 'package:invoiceninja_flutter/redux/company/company_state.dart';
|
|||
import 'package:invoiceninja_flutter/redux/ui/ui_state.dart';
|
||||
import 'package:invoiceninja_flutter/data/models/serializers.dart';
|
||||
import 'package:invoiceninja_flutter/data/file_storage.dart';
|
||||
// ignore: unused_import
|
||||
import 'package:invoiceninja_flutter/utils/web_stub.dart'
|
||||
if (dart.library.html) 'package:invoiceninja_flutter/utils/web.dart';
|
||||
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ class TaxRateRepository {
|
|||
credentials.url + '/tax_rates', credentials.token,
|
||||
data: json.encode(data));
|
||||
} else {
|
||||
var url = credentials.url + '/tax_rates/${taxRate.id}';
|
||||
final url = credentials.url + '/tax_rates/${taxRate.id}';
|
||||
response =
|
||||
await webClient.put(url, credentials.token, data: json.encode(data));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ import 'package:invoiceninja_flutter/redux/payment/payment_actions.dart';
|
|||
import 'package:invoiceninja_flutter/redux/product/product_actions.dart';
|
||||
import 'package:invoiceninja_flutter/redux/project/project_actions.dart';
|
||||
import 'package:invoiceninja_flutter/redux/quote/quote_actions.dart';
|
||||
import 'package:invoiceninja_flutter/redux/settings/settings_actions.dart';
|
||||
import 'package:invoiceninja_flutter/redux/task/task_actions.dart';
|
||||
import 'package:invoiceninja_flutter/redux/tax_rate/tax_rate_actions.dart';
|
||||
import 'package:invoiceninja_flutter/redux/ui/pref_state.dart';
|
||||
|
|
|
|||
|
|
@ -527,7 +527,7 @@ abstract class AppState implements Built<AppState, AppStateBuilder> {
|
|||
//return 'Notifications: ${user.userCompany.notifications} ${uiState.settingsUIState.user.userCompany.notifications}';
|
||||
//return 'SORT: Sort Ascending: ${uiState.productUIState.listUIState.sortAscending}';
|
||||
//return 'URL: ${authState.url}';
|
||||
return 'PLAN: ${account.plan}';
|
||||
//return 'PLAN: ${account.plan}';
|
||||
return 'Layout: ${prefState.appLayout}, Route: ${uiState.currentRoute} Prev: ${uiState.previousRoute}';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:invoiceninja_flutter/.env.dart';
|
||||
|
|
@ -7,7 +6,6 @@ import 'package:invoiceninja_flutter/constants.dart';
|
|||
import 'package:invoiceninja_flutter/redux/app/app_actions.dart';
|
||||
import 'package:invoiceninja_flutter/redux/client/client_actions.dart';
|
||||
import 'package:invoiceninja_flutter/redux/company/company_actions.dart';
|
||||
import 'package:invoiceninja_flutter/redux/company/company_selectors.dart';
|
||||
import 'package:invoiceninja_flutter/redux/dashboard/dashboard_actions.dart';
|
||||
import 'package:invoiceninja_flutter/redux/ui/ui_actions.dart';
|
||||
import 'package:invoiceninja_flutter/ui/auth/login_vm.dart';
|
||||
|
|
@ -15,7 +13,6 @@ import 'package:invoiceninja_flutter/utils/formatting.dart';
|
|||
import 'package:redux/redux.dart';
|
||||
import 'package:invoiceninja_flutter/redux/auth/auth_actions.dart';
|
||||
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
|
||||
import 'package:invoiceninja_flutter/utils/platforms.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:invoiceninja_flutter/data/repositories/auth_repository.dart';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
import 'package:invoiceninja_flutter/constants.dart';
|
||||
import 'package:invoiceninja_flutter/utils/formatting.dart';
|
||||
import 'package:invoiceninja_flutter/.env.dart';
|
||||
|
||||
part 'auth_state.g.dart';
|
||||
|
|
|
|||
|
|
@ -258,8 +258,6 @@ void handleDesignAction(
|
|||
}
|
||||
|
||||
final store = StoreProvider.of<AppState>(context);
|
||||
final state = store.state;
|
||||
final CompanyEntity company = state.company;
|
||||
final localization = AppLocalization.of(context);
|
||||
final design = designs.first as DesignEntity;
|
||||
final designIds = designs.map((design) => design.id).toList();
|
||||
|
|
|
|||
|
|
@ -6,9 +6,7 @@ import 'package:invoiceninja_flutter/redux/company/company_actions.dart';
|
|||
import 'package:invoiceninja_flutter/redux/ui/entity_ui_state.dart';
|
||||
import 'package:invoiceninja_flutter/redux/design/design_actions.dart';
|
||||
import 'package:invoiceninja_flutter/redux/ui/list_ui_state.dart';
|
||||
import 'package:invoiceninja_flutter/redux/design/design_actions.dart';
|
||||
import 'package:invoiceninja_flutter/redux/design/design_state.dart';
|
||||
import 'package:invoiceninja_flutter/data/models/entities.dart';
|
||||
|
||||
EntityUIState designUIReducer(DesignUIState state, dynamic action) {
|
||||
return state.rebuild((b) => b
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ import 'package:invoiceninja_flutter/data/models/client_model.dart';
|
|||
import 'package:invoiceninja_flutter/data/models/invoice_model.dart';
|
||||
import 'package:invoiceninja_flutter/redux/app/app_actions.dart';
|
||||
import 'package:invoiceninja_flutter/redux/company/company_actions.dart';
|
||||
import 'package:invoiceninja_flutter/redux/quote/quote_actions.dart';
|
||||
import 'package:invoiceninja_flutter/redux/ui/entity_ui_state.dart';
|
||||
import 'package:invoiceninja_flutter/redux/ui/list_ui_state.dart';
|
||||
import 'package:redux/redux.dart';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import 'package:built_collection/built_collection.dart';
|
||||
import 'package:invoiceninja_flutter/constants.dart';
|
||||
import 'package:invoiceninja_flutter/data/models/invoice_model.dart';
|
||||
import 'package:invoiceninja_flutter/redux/app/app_actions.dart';
|
||||
import 'package:invoiceninja_flutter/redux/company/company_actions.dart';
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ class MessageDialog extends StatelessWidget {
|
|||
SizedBox(height: 20.0),
|
||||
Text(
|
||||
message,
|
||||
style: Theme.of(context).textTheme.title,
|
||||
style: Theme.of(context).textTheme.headline6,
|
||||
),
|
||||
SizedBox(height: 40.0),
|
||||
Row(
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class ErrorDialog extends StatelessWidget {
|
|||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Text(localization.anErrorOccurred,
|
||||
style: Theme.of(context).textTheme.title),
|
||||
style: Theme.of(context).textTheme.headline6),
|
||||
SizedBox(height: 20.0),
|
||||
Text(error.toString()),
|
||||
SizedBox(height: 40.0),
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ class MultiSelectListState extends State<MultiSelectList> {
|
|||
? localization.lookup(option)
|
||||
: columnTitle,
|
||||
textAlign: TextAlign.left,
|
||||
style: Theme.of(context).textTheme.title,
|
||||
style: Theme.of(context).textTheme.headline6,
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
|
|
|
|||
|
|
@ -168,10 +168,10 @@ class DocumentTile extends StatelessWidget {
|
|||
SizedBox(height: 25),
|
||||
Text(document.name,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: Theme.of(context).textTheme.headline),
|
||||
style: Theme.of(context).textTheme.headline5),
|
||||
Text(
|
||||
'${formatDate(convertTimestampToDateString(document.createdAt), context)} • ${document.prettySize}',
|
||||
style: Theme.of(context).textTheme.headline,
|
||||
style: Theme.of(context).textTheme.headline5,
|
||||
),
|
||||
SizedBox(height: 20),
|
||||
DocumentPreview(document),
|
||||
|
|
@ -207,7 +207,7 @@ class DocumentTile extends StatelessWidget {
|
|||
children: <Widget>[
|
||||
Text(
|
||||
document.name ?? '',
|
||||
style: Theme.of(context).textTheme.headline,
|
||||
style: Theme.of(context).textTheme.headline5,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
Text(
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import 'package:invoiceninja_flutter/redux/app/app_state.dart';
|
|||
import 'package:invoiceninja_flutter/redux/settings/settings_actions.dart';
|
||||
import 'package:invoiceninja_flutter/redux/ui/pref_state.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/forms/save_cancel_buttons.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/menu_drawer.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/menu_drawer_vm.dart';
|
||||
import 'package:invoiceninja_flutter/utils/icons.dart';
|
||||
import 'package:invoiceninja_flutter/utils/platforms.dart';
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ import 'package:flutter/cupertino.dart';
|
|||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_redux/flutter_redux.dart';
|
||||
import 'package:invoiceninja_flutter/constants.dart';
|
||||
import 'package:invoiceninja_flutter/data/web_client.dart';
|
||||
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/loading_indicator.dart';
|
||||
|
|
|
|||
|
|
@ -82,8 +82,8 @@ abstract class StubEntity extends Object with BaseEntity implements Built<StubEn
|
|||
|
||||
int compareTo(StubEntity stub, String sortField, bool sortAscending) {
|
||||
int response = 0;
|
||||
StubEntity stubA = sortAscending ? this : stub;
|
||||
StubEntity stubB = sortAscending ? stub: this;
|
||||
final stubA = sortAscending ? this : stub;
|
||||
final stubB = sortAscending ? stub: this;
|
||||
|
||||
switch (sortField) {
|
||||
// STARTER: sort switch - do not remove comment
|
||||
|
|
|
|||
Loading…
Reference in New Issue