diff --git a/packages/wyatt_ui_components/lib/src/core/enums/control_state.dart b/packages/wyatt_ui_components/lib/src/core/enums/control_state.dart index e4629e75..c2e83c43 100644 --- a/packages/wyatt_ui_components/lib/src/core/enums/control_state.dart +++ b/packages/wyatt_ui_components/lib/src/core/enums/control_state.dart @@ -14,6 +14,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . +/// Defines standard UI control states enum ControlState { /// When the control is disabled and un-clickable disabled, diff --git a/packages/wyatt_ui_components/lib/src/core/enums/enums.dart b/packages/wyatt_ui_components/lib/src/core/enums/enums.dart index 9b4b1438..75260d47 100644 --- a/packages/wyatt_ui_components/lib/src/core/enums/enums.dart +++ b/packages/wyatt_ui_components/lib/src/core/enums/enums.dart @@ -15,4 +15,5 @@ // along with this program. If not, see . export './control_state.dart'; +export './extra_state.dart'; export './status_state.dart'; diff --git a/packages/wyatt_ui_components/lib/src/core/enums/extra_state.dart b/packages/wyatt_ui_components/lib/src/core/enums/extra_state.dart new file mode 100644 index 00000000..6cf782bb --- /dev/null +++ b/packages/wyatt_ui_components/lib/src/core/enums/extra_state.dart @@ -0,0 +1,35 @@ +// Copyright (C) 2023 WYATT GROUP +// Please see the AUTHORS file for details. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart'; + +/// Defines extra UI control states that can +/// be combined with [ControlState] +enum ExtraState { + /// When the control is selected + selected, + + /// When the control is invalid + invalid, + + /// When the control is freezed + /// Useful to prevent user from changing the control state + freezed; + + bool isSelected() => this == ExtraState.selected; + bool isInvalid() => this == ExtraState.invalid; + bool isFreezed() => this == ExtraState.freezed; +}