mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-11-26 18:44:55 +00:00
formatted all files.
This commit is contained in:
@ -7,11 +7,10 @@ class CounterWidget extends StatefulWidget {
|
||||
final bool isCreate;
|
||||
|
||||
const CounterWidget(
|
||||
{Key? key,
|
||||
{super.key,
|
||||
this.initialCount = 0,
|
||||
required this.onCountChanged,
|
||||
required this.isCreate})
|
||||
: super(key: key);
|
||||
required this.isCreate});
|
||||
|
||||
@override
|
||||
State<CounterWidget> createState() => _CounterWidgetState();
|
||||
@ -55,7 +54,8 @@ class _CounterWidgetState extends State<CounterWidget> {
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
_buildCounterButton(Icons.remove, _decrementCounter,!widget.isCreate ),
|
||||
_buildCounterButton(
|
||||
Icons.remove, _decrementCounter, !widget.isCreate),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
'$_counter',
|
||||
@ -69,12 +69,15 @@ class _CounterWidgetState extends State<CounterWidget> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildCounterButton(IconData icon, VoidCallback onPressed, bool isDisabled) {
|
||||
Widget _buildCounterButton(
|
||||
IconData icon, VoidCallback onPressed, bool isDisabled) {
|
||||
return GestureDetector(
|
||||
onTap: isDisabled? null: onPressed,
|
||||
onTap: isDisabled ? null : onPressed,
|
||||
child: Icon(
|
||||
icon,
|
||||
color: isDisabled? ColorsManager.spaceColor.withOpacity(0.3): ColorsManager.spaceColor,
|
||||
color: isDisabled
|
||||
? ColorsManager.spaceColor.withValues(alpha: 0.3)
|
||||
: ColorsManager.spaceColor,
|
||||
size: 18,
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user