formatted all files.

This commit is contained in:
Faris Armoush
2025-06-12 15:33:32 +03:00
parent 29959f567e
commit 04250ebc98
474 changed files with 5425 additions and 4338 deletions

View File

@ -16,8 +16,9 @@ class FetchRoutineScenesAutomation extends StatelessWidget
Widget build(BuildContext context) {
return BlocBuilder<RoutineBloc, RoutineState>(
builder: (context, state) {
if (state.isLoading)
if (state.isLoading) {
return const Center(child: CircularProgressIndicator());
}
return SingleChildScrollView(
child: Padding(
@ -26,23 +27,23 @@ class FetchRoutineScenesAutomation extends StatelessWidget
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
_buildListTitle(context, "Scenes (Tap to Run)"),
_buildListTitle(context, 'Scenes (Tap to Run)'),
const SizedBox(height: 10),
Visibility(
visible: state.scenes.isNotEmpty,
replacement: _buildEmptyState(context, "No scenes found"),
replacement: _buildEmptyState(context, 'No scenes found'),
child: SizedBox(
height: 200,
child: _buildScenes(state),
),
),
const SizedBox(height: 10),
_buildListTitle(context, "Automations"),
_buildListTitle(context, 'Automations'),
const SizedBox(height: 3),
Visibility(
visible: state.automations.isNotEmpty,
replacement:
_buildEmptyState(context, "No automations found"),
_buildEmptyState(context, 'No automations found'),
child: SizedBox(
height: 200,
child: _buildAutomations(state),

View File

@ -67,15 +67,15 @@ class _RoutineViewCardState extends State<RoutineViewCard> {
@override
Widget build(BuildContext context) {
final double cardWidth = widget.isSmallScreenSize(context)
final cardWidth = widget.isSmallScreenSize(context)
? 120
: widget.isMediumScreenSize(context)
? 135
: 150;
final double cardHeight = widget.isSmallScreenSize(context) ? 190 : 200;
final cardHeight = widget.isSmallScreenSize(context) ? 190 : 200;
final double iconSize = widget.isSmallScreenSize(context)
final iconSize = widget.isSmallScreenSize(context)
? 70
: widget.isMediumScreenSize(context)
? 80
@ -99,41 +99,42 @@ class _RoutineViewCardState extends State<RoutineViewCard> {
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
widget.cardType != ''
? Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
if (widget.isFromScenes ?? false)
InkWell(
onTap: _handleSceneTap,
child: Image.asset(
_showTemporaryCheck
? Assets.scenesPlayIcon
: Assets.scenesPlayIconCheck,
fit: BoxFit.contain,
),
)
else if (widget.isLoading)
const SizedBox(
width: 49,
height: 20,
child: Center(
child: SizedBox(
width: 16,
height: 16,
child: CircularProgressIndicator(strokeWidth: 2),
),
),
)
else
CupertinoSwitch(
activeTrackColor: ColorsManager.primaryColor,
value: widget.status == 'enable',
onChanged: widget.onChanged,
)
],
)
: const SizedBox(),
if (widget.cardType != '')
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
if (widget.isFromScenes ?? false)
InkWell(
onTap: _handleSceneTap,
child: Image.asset(
_showTemporaryCheck
? Assets.scenesPlayIcon
: Assets.scenesPlayIconCheck,
fit: BoxFit.contain,
),
)
else if (widget.isLoading)
const SizedBox(
width: 49,
height: 20,
child: Center(
child: SizedBox(
width: 16,
height: 16,
child: CircularProgressIndicator(strokeWidth: 2),
),
),
)
else
CupertinoSwitch(
activeTrackColor: ColorsManager.primaryColor,
value: widget.status == 'enable',
onChanged: widget.onChanged,
)
],
)
else
const SizedBox(),
Column(
children: [
Center(
@ -159,8 +160,9 @@ class _RoutineViewCardState extends State<RoutineViewCard> {
height: iconSize,
width: iconSize,
fit: BoxFit.contain,
errorBuilder: (context, error, stackTrace) =>
Image.asset(
errorBuilder:
(context, error, stackTrace) =>
Image.asset(
Assets.logo,
height: iconSize,
width: iconSize,
@ -203,7 +205,8 @@ class _RoutineViewCardState extends State<RoutineViewCard> {
maxLines: 1,
style: context.textTheme.bodySmall?.copyWith(
color: ColorsManager.blackColor,
fontSize: widget.isSmallScreenSize(context) ? 10 : 12,
fontSize:
widget.isSmallScreenSize(context) ? 10 : 12,
),
),
if (widget.spaceName != '')
@ -222,8 +225,9 @@ class _RoutineViewCardState extends State<RoutineViewCard> {
maxLines: 1,
style: context.textTheme.bodySmall?.copyWith(
color: ColorsManager.blackColor,
fontSize:
widget.isSmallScreenSize(context) ? 10 : 12,
fontSize: widget.isSmallScreenSize(context)
? 10
: 12,
),
),
],