Set default tab to 0
This commit is contained in:
parent
eb0e482b39
commit
8394a8b3c0
|
|
@ -6,7 +6,7 @@ class Constants {
|
|||
}
|
||||
|
||||
// TODO remove version once #46609 is fixed
|
||||
const String kClientVersion = '5.0.41';
|
||||
const String kClientVersion = '5.0.42';
|
||||
const String kMinServerVersion = '5.0.4';
|
||||
|
||||
const String kAppName = 'Invoice Ninja';
|
||||
|
|
|
|||
|
|
@ -1407,7 +1407,7 @@ void selectEntity({
|
|||
!entity.entityType.isSetting &&
|
||||
entityUIState.selectedId == entity.id &&
|
||||
state.prefState.isPreviewVisible) {
|
||||
if ((entityUIState.tabIndex ?? 0) > 0) {
|
||||
if (entityUIState.tabIndex > 0) {
|
||||
store.dispatch(PreviewEntity());
|
||||
} else {
|
||||
editEntity(context: context, entity: entity);
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ final tabIndexReducer = combineReducers<int>([
|
|||
return action.tabIndex;
|
||||
}),
|
||||
TypedReducer<int, PreviewEntity>((completer, action) {
|
||||
return null;
|
||||
return 0;
|
||||
}),
|
||||
]);
|
||||
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ abstract class ClientUIState extends Object
|
|||
editing: ClientEntity(),
|
||||
editingContact: ContactEntity(),
|
||||
saveCompleter: null,
|
||||
tabIndex: 0,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ abstract class CompanyGatewayUIState extends Object
|
|||
listUIState: ListUIState(CompanyGatewayFields.name),
|
||||
editing: CompanyGatewayEntity(),
|
||||
selectedId: '',
|
||||
tabIndex: 0,
|
||||
);
|
||||
}
|
||||
CompanyGatewayUIState._();
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ final tabIndexReducer = combineReducers<int>([
|
|||
return action.tabIndex;
|
||||
}),
|
||||
TypedReducer<int, PreviewEntity>((completer, action) {
|
||||
return null;
|
||||
return 0;
|
||||
}),
|
||||
]);
|
||||
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@ abstract class CreditUIState extends Object
|
|||
listUIState: ListUIState(CreditFields.number, sortAscending: false),
|
||||
editing: InvoiceEntity(),
|
||||
selectedId: '',
|
||||
tabIndex: 0,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ abstract class DesignUIState extends Object
|
|||
listUIState: ListUIState(DesignFields.name),
|
||||
editing: DesignEntity(),
|
||||
selectedId: '',
|
||||
tabIndex: 0,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ abstract class DocumentUIState extends Object
|
|||
listUIState: ListUIState(DocumentFields.name),
|
||||
editing: DocumentEntity(),
|
||||
selectedId: '',
|
||||
tabIndex: 0,
|
||||
);
|
||||
}
|
||||
DocumentUIState._();
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ final tabIndexReducer = combineReducers<int>([
|
|||
return action.tabIndex;
|
||||
}),
|
||||
TypedReducer<int, PreviewEntity>((completer, action) {
|
||||
return null;
|
||||
return 0;
|
||||
}),
|
||||
]);
|
||||
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@ abstract class ExpenseUIState extends Object
|
|||
listUIState: ListUIState(ExpenseFields.number, sortAscending: false),
|
||||
editing: ExpenseEntity(),
|
||||
selectedId: '',
|
||||
tabIndex: 0,
|
||||
);
|
||||
}
|
||||
ExpenseUIState._();
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ abstract class ExpenseCategoryUIState extends Object
|
|||
listUIState: ListUIState(ExpenseCategoryFields.name),
|
||||
editing: ExpenseCategoryEntity(),
|
||||
selectedId: '',
|
||||
tabIndex: 0,
|
||||
);
|
||||
}
|
||||
ExpenseCategoryUIState._();
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ abstract class GroupUIState extends Object
|
|||
listUIState: ListUIState(GroupFields.name),
|
||||
editing: GroupEntity(),
|
||||
selectedId: '',
|
||||
tabIndex: 0,
|
||||
);
|
||||
}
|
||||
GroupUIState._();
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ final tabIndexReducer = combineReducers<int>([
|
|||
return action.tabIndex;
|
||||
}),
|
||||
TypedReducer<int, PreviewEntity>((completer, action) {
|
||||
return null;
|
||||
return 0;
|
||||
}),
|
||||
]);
|
||||
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ abstract class InvoiceUIState extends Object
|
|||
listUIState: ListUIState(InvoiceFields.number, sortAscending: false),
|
||||
editing: InvoiceEntity(),
|
||||
selectedId: '',
|
||||
tabIndex: 0,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ final tabIndexReducer = combineReducers<int>([
|
|||
return action.tabIndex;
|
||||
}),
|
||||
TypedReducer<int, PreviewEntity>((completer, action) {
|
||||
return null;
|
||||
return 0;
|
||||
}),
|
||||
]);
|
||||
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ abstract class PaymentUIState extends Object
|
|||
listUIState: ListUIState(PaymentFields.number, sortAscending: false),
|
||||
editing: PaymentEntity(),
|
||||
selectedId: '',
|
||||
tabIndex: 0,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ abstract class PaymentTermUIState extends Object
|
|||
listUIState: ListUIState(PaymentTermFields.name),
|
||||
editing: PaymentTermEntity(),
|
||||
selectedId: '',
|
||||
tabIndex: 0,
|
||||
);
|
||||
}
|
||||
PaymentTermUIState._();
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ final tabIndexReducer = combineReducers<int>([
|
|||
return action.tabIndex;
|
||||
}),
|
||||
TypedReducer<int, PreviewEntity>((completer, action) {
|
||||
return null;
|
||||
return 0;
|
||||
}),
|
||||
]);
|
||||
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ abstract class ProductUIState extends Object
|
|||
listUIState: ListUIState(ProductFields.productKey),
|
||||
editing: ProductEntity(),
|
||||
selectedId: '',
|
||||
tabIndex: 0,
|
||||
);
|
||||
}
|
||||
ProductUIState._();
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ final tabIndexReducer = combineReducers<int>([
|
|||
return action.tabIndex;
|
||||
}),
|
||||
TypedReducer<int, PreviewEntity>((completer, action) {
|
||||
return null;
|
||||
return 0;
|
||||
}),
|
||||
]);
|
||||
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ abstract class ProjectUIState extends Object
|
|||
listUIState: ListUIState(ProjectFields.number, sortAscending: false),
|
||||
editing: ProjectEntity(),
|
||||
selectedId: '',
|
||||
tabIndex: 0,
|
||||
);
|
||||
}
|
||||
ProjectUIState._();
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ final tabIndexReducer = combineReducers<int>([
|
|||
return action.tabIndex;
|
||||
}),
|
||||
TypedReducer<int, PreviewEntity>((completer, action) {
|
||||
return null;
|
||||
return 0;
|
||||
}),
|
||||
]);
|
||||
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ abstract class QuoteUIState extends Object
|
|||
listUIState: ListUIState(QuoteFields.number, sortAscending: false),
|
||||
editing: InvoiceEntity(),
|
||||
selectedId: '',
|
||||
tabIndex: 0,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ final tabIndexReducer = combineReducers<int>([
|
|||
return action.tabIndex;
|
||||
}),
|
||||
TypedReducer<int, PreviewEntity>((completer, action) {
|
||||
return null;
|
||||
return 0;
|
||||
}),
|
||||
]);
|
||||
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@ abstract class RecurringInvoiceUIState extends Object
|
|||
listUIState: ListUIState(InvoiceFields.number),
|
||||
editing: InvoiceEntity(),
|
||||
selectedId: '',
|
||||
tabIndex: 0,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ final tabIndexReducer = combineReducers<int>([
|
|||
return action.tabIndex;
|
||||
}),
|
||||
TypedReducer<int, PreviewEntity>((completer, action) {
|
||||
return null;
|
||||
return 0;
|
||||
}),
|
||||
]);
|
||||
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ abstract class TaskUIState extends Object
|
|||
listUIState: ListUIState(TaskFields.number, sortAscending: false),
|
||||
editing: TaskEntity(),
|
||||
selectedId: '',
|
||||
tabIndex: 0,
|
||||
);
|
||||
}
|
||||
TaskUIState._();
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ abstract class TaskStatusUIState extends Object
|
|||
listUIState: ListUIState(TaskStatusFields.name),
|
||||
editing: TaskStatusEntity(),
|
||||
selectedId: '',
|
||||
tabIndex: 0,
|
||||
);
|
||||
}
|
||||
TaskStatusUIState._();
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ abstract class TaxRateUIState extends Object
|
|||
listUIState: ListUIState(TaxRateFields.name),
|
||||
editing: TaxRateEntity(),
|
||||
selectedId: '',
|
||||
tabIndex: 0,
|
||||
);
|
||||
}
|
||||
TaxRateUIState._();
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ abstract class TokenUIState extends Object
|
|||
listUIState: ListUIState(TokenFields.name),
|
||||
editing: TokenEntity(),
|
||||
selectedId: '',
|
||||
tabIndex: 0,
|
||||
);
|
||||
}
|
||||
TokenUIState._();
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ abstract class EntityUIState {
|
|||
@nullable
|
||||
String get selectedId;
|
||||
|
||||
@nullable
|
||||
int get tabIndex;
|
||||
|
||||
@nullable
|
||||
|
|
|
|||
|
|
@ -198,7 +198,7 @@ Reducer<SettingsUIState> settingsUIReducer = combineReducers([
|
|||
..origUser.replace(action.user ?? state.origUser)
|
||||
..updatedAt = DateTime.now().millisecondsSinceEpoch
|
||||
..section = action.section ?? state.section
|
||||
..tabIndex = action.tabIndex ?? 0
|
||||
..tabIndex = action.tabIndex
|
||||
..isChanged = false
|
||||
..entityType = action.client != null
|
||||
? EntityType.client
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ abstract class UserUIState extends Object
|
|||
listUIState: ListUIState(UserFields.firstName),
|
||||
editing: UserEntity(),
|
||||
selectedId: '',
|
||||
tabIndex: 0,
|
||||
);
|
||||
}
|
||||
UserUIState._();
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ final tabIndexReducer = combineReducers<int>([
|
|||
return action.tabIndex;
|
||||
}),
|
||||
TypedReducer<int, PreviewEntity>((completer, action) {
|
||||
return null;
|
||||
return 0;
|
||||
}),
|
||||
]);
|
||||
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ abstract class VendorUIState extends Object
|
|||
editing: VendorEntity(),
|
||||
editingContact: VendorContactEntity(),
|
||||
selectedId: '',
|
||||
tabIndex: 0,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ abstract class WebhookUIState extends Object
|
|||
listUIState: ListUIState(WebhookFields.targetUrl),
|
||||
editing: WebhookEntity(),
|
||||
selectedId: '',
|
||||
tabIndex: 0,
|
||||
);
|
||||
}
|
||||
WebhookUIState._();
|
||||
|
|
|
|||
|
|
@ -42,9 +42,7 @@ class _ClientViewState extends State<ClientView>
|
|||
|
||||
final state = widget.viewModel.state;
|
||||
_controller = TabController(
|
||||
vsync: this,
|
||||
length: 6,
|
||||
initialIndex: state.clientUIState.tabIndex ?? 0);
|
||||
vsync: this, length: 6, initialIndex: state.clientUIState.tabIndex);
|
||||
_controller.addListener(_onTabChanged);
|
||||
}
|
||||
|
||||
|
|
@ -58,7 +56,7 @@ class _ClientViewState extends State<ClientView>
|
|||
super.didUpdateWidget(oldWidget);
|
||||
|
||||
if (oldWidget.tabIndex != widget.tabIndex) {
|
||||
_controller.index = widget.tabIndex ?? 0;
|
||||
_controller.index = widget.tabIndex;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -42,9 +42,7 @@ class _ExpenseViewState extends State<ExpenseView>
|
|||
|
||||
final state = widget.viewModel.state;
|
||||
_controller = TabController(
|
||||
vsync: this,
|
||||
length: 2,
|
||||
initialIndex: state.expenseUIState.tabIndex ?? 0);
|
||||
vsync: this, length: 2, initialIndex: state.expenseUIState.tabIndex);
|
||||
_controller.addListener(_onTabChanged);
|
||||
}
|
||||
|
||||
|
|
@ -58,7 +56,7 @@ class _ExpenseViewState extends State<ExpenseView>
|
|||
super.didUpdateWidget(oldWidget);
|
||||
|
||||
if (oldWidget.tabIndex != widget.tabIndex) {
|
||||
_controller.index = widget.tabIndex ?? 0;
|
||||
_controller.index = widget.tabIndex;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ class _InvoiceViewState extends State<InvoiceView>
|
|||
_controller = TabController(
|
||||
vsync: this,
|
||||
length: invoice.isRecurring ? 5 : 4,
|
||||
initialIndex: tabIndex ?? 0);
|
||||
initialIndex: tabIndex);
|
||||
_controller.addListener(_onTabChanged);
|
||||
}
|
||||
|
||||
|
|
@ -83,7 +83,7 @@ class _InvoiceViewState extends State<InvoiceView>
|
|||
super.didUpdateWidget(oldWidget);
|
||||
|
||||
if (oldWidget.tabIndex != widget.tabIndex) {
|
||||
_controller.index = widget.tabIndex ?? 0;
|
||||
_controller.index = widget.tabIndex;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,9 +38,7 @@ class _ProductViewState extends State<ProductView>
|
|||
|
||||
final state = widget.viewModel.state;
|
||||
_controller = TabController(
|
||||
vsync: this,
|
||||
length: 2,
|
||||
initialIndex: state.productUIState.tabIndex ?? 0);
|
||||
vsync: this, length: 2, initialIndex: state.productUIState.tabIndex);
|
||||
_controller.addListener(_onTabChanged);
|
||||
}
|
||||
|
||||
|
|
@ -54,7 +52,7 @@ class _ProductViewState extends State<ProductView>
|
|||
super.didUpdateWidget(oldWidget);
|
||||
|
||||
if (oldWidget.tabIndex != widget.tabIndex) {
|
||||
_controller.index = widget.tabIndex ?? 0;
|
||||
_controller.index = widget.tabIndex;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,9 +38,7 @@ class _ProjectViewState extends State<ProjectView>
|
|||
|
||||
final state = widget.viewModel.state;
|
||||
_controller = TabController(
|
||||
vsync: this,
|
||||
length: 2,
|
||||
initialIndex: state.projectUIState.tabIndex ?? 0);
|
||||
vsync: this, length: 2, initialIndex: state.projectUIState.tabIndex);
|
||||
_controller.addListener(_onTabChanged);
|
||||
}
|
||||
|
||||
|
|
@ -54,7 +52,7 @@ class _ProjectViewState extends State<ProjectView>
|
|||
super.didUpdateWidget(oldWidget);
|
||||
|
||||
if (oldWidget.tabIndex != widget.tabIndex) {
|
||||
_controller.index = widget.tabIndex ?? 0;
|
||||
_controller.index = widget.tabIndex;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ class _TaskViewState extends State<TaskView>
|
|||
|
||||
final state = widget.viewModel.state;
|
||||
_controller = TabController(
|
||||
vsync: this, length: 2, initialIndex: state.taskUIState.tabIndex ?? 0);
|
||||
vsync: this, length: 2, initialIndex: state.taskUIState.tabIndex);
|
||||
_controller.addListener(_onTabChanged);
|
||||
}
|
||||
|
||||
|
|
@ -52,7 +52,7 @@ class _TaskViewState extends State<TaskView>
|
|||
super.didUpdateWidget(oldWidget);
|
||||
|
||||
if (oldWidget.tabIndex != widget.tabIndex) {
|
||||
_controller.index = widget.tabIndex ?? 0;
|
||||
_controller.index = widget.tabIndex;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -37,9 +37,7 @@ class _VendorViewState extends State<VendorView>
|
|||
|
||||
final state = widget.viewModel.state;
|
||||
_controller = TabController(
|
||||
vsync: this,
|
||||
length: 3,
|
||||
initialIndex: state.vendorUIState.tabIndex ?? 0);
|
||||
vsync: this, length: 3, initialIndex: state.vendorUIState.tabIndex);
|
||||
_controller.addListener(_onTabChanged);
|
||||
}
|
||||
|
||||
|
|
@ -53,7 +51,7 @@ class _VendorViewState extends State<VendorView>
|
|||
super.didUpdateWidget(oldWidget);
|
||||
|
||||
if (oldWidget.tabIndex != widget.tabIndex) {
|
||||
_controller.index = widget.tabIndex ?? 0;
|
||||
_controller.index = widget.tabIndex;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
name: invoiceninja_flutter
|
||||
description: Client for Invoice Ninja
|
||||
version: 5.0.41+41
|
||||
version: 5.0.42+42
|
||||
author: Hillel Coren
|
||||
homepage: https://invoiceninja.com
|
||||
documentation: http://docs.invoiceninja.com
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ final tabIndexReducer = combineReducers<int>([
|
|||
return action.tabIndex;
|
||||
}),
|
||||
TypedReducer<int, PreviewEntity>((completer, action) {
|
||||
return null;
|
||||
return 0;
|
||||
}),
|
||||
]);
|
||||
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ abstract class StubUIState extends Object with EntityUIState implements Built<St
|
|||
listUIState: ListUIState(StubFields.name),
|
||||
editing: StubEntity(),
|
||||
selectedId: '',
|
||||
tabIndex: 0,
|
||||
);
|
||||
}
|
||||
StubUIState._();
|
||||
|
|
|
|||
Loading…
Reference in New Issue