ui_kit/refactor/buttons #158
@ -14,6 +14,7 @@
 | 
			
		||||
// You should have received a copy of the GNU General Public License
 | 
			
		||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
 | 
			
		||||
 | 
			
		||||
/// Defines standard UI control states
 | 
			
		||||
enum ControlState {
 | 
			
		||||
  /// When the control is disabled and un-clickable
 | 
			
		||||
  disabled,
 | 
			
		||||
 | 
			
		||||
@ -15,4 +15,5 @@
 | 
			
		||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
 | 
			
		||||
 | 
			
		||||
export './control_state.dart';
 | 
			
		||||
export './extra_state.dart';
 | 
			
		||||
export './status_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 <https://www.gnu.org/licenses/>.
 | 
			
		||||
 | 
			
		||||
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;
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user