Correct subscription cancel button
This commit is contained in:
parent
359349e29b
commit
a49b84101e
|
|
@ -37,7 +37,7 @@ class SaveCancelButtons extends StatelessWidget {
|
|||
return TextButton(
|
||||
child: Text(
|
||||
cancelLabel ?? localization.cancel,
|
||||
style: isHeader && isEnabled
|
||||
style: isHeader && (isEnabled || isCancelEnabled)
|
||||
? TextStyle(color: store.state.headerTextColor)
|
||||
: null,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ class CompanyGatewayScreen extends StatelessWidget {
|
|||
appBarActions: [
|
||||
if (viewModel.isInMultiselect)
|
||||
SaveCancelButtons(
|
||||
isHeader: true,
|
||||
saveLabel: localization.done,
|
||||
onSavePressed: listUIState.selectedIds.isEmpty
|
||||
? null
|
||||
|
|
@ -80,6 +81,7 @@ class CompanyGatewayScreen extends StatelessWidget {
|
|||
SaveCancelButtons(
|
||||
isEnabled: state.uiState.settingsUIState.isChanged,
|
||||
isCancelEnabled: true,
|
||||
isHeader: true,
|
||||
isSaving: state.isSaving,
|
||||
onSavePressed: viewModel.onSavePressed,
|
||||
onCancelPressed: (_) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:invoiceninja_flutter/data/models/company_model.dart';
|
||||
import 'package:invoiceninja_flutter/data/models/entities.dart';
|
||||
import 'package:invoiceninja_flutter/data/models/models.dart';
|
||||
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ class _SubscriptionViewState extends State<SubscriptionView> {
|
|||
return ViewScaffold(
|
||||
isFilter: widget.isFilter,
|
||||
entity: subscription,
|
||||
onBackPressed: () => viewModel.onBackPressed(),
|
||||
body: ScrollableListView(
|
||||
children: <Widget>[
|
||||
EntityHeader(
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ import 'package:invoiceninja_flutter/constants.dart';
|
|||
import 'package:invoiceninja_flutter/redux/app/app_actions.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:invoiceninja_flutter/redux/ui/ui_actions.dart';
|
||||
import 'package:invoiceninja_flutter/ui/subscription/subscription_screen.dart';
|
||||
import 'package:invoiceninja_flutter/utils/completers.dart';
|
||||
import 'package:invoiceninja_flutter/utils/localization.dart';
|
||||
import 'package:redux/redux.dart';
|
||||
|
|
@ -45,6 +47,7 @@ class SubscriptionViewVM {
|
|||
@required this.onEntityAction,
|
||||
@required this.onRefreshed,
|
||||
@required this.isSaving,
|
||||
@required this.onBackPressed,
|
||||
@required this.isLoading,
|
||||
@required this.isDirty,
|
||||
});
|
||||
|
|
@ -71,6 +74,9 @@ class SubscriptionViewVM {
|
|||
isDirty: subscription.isNew,
|
||||
subscription: subscription,
|
||||
onRefreshed: (context) => _handleRefresh(context),
|
||||
onBackPressed: () {
|
||||
store.dispatch(UpdateCurrentRoute(SubscriptionScreen.route));
|
||||
},
|
||||
onEntityAction: (BuildContext context, EntityAction action) =>
|
||||
handleEntitiesActions(context, [subscription], action, autoPop: true),
|
||||
);
|
||||
|
|
@ -81,6 +87,7 @@ class SubscriptionViewVM {
|
|||
final CompanyEntity company;
|
||||
final Function(BuildContext, EntityAction) onEntityAction;
|
||||
final Function(BuildContext) onRefreshed;
|
||||
final Function onBackPressed;
|
||||
final bool isSaving;
|
||||
final bool isLoading;
|
||||
final bool isDirty;
|
||||
|
|
|
|||
Loading…
Reference in New Issue