mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2026-10-24 12:17:55 +00:00
Refactor DevicesViewBody and SceneView to improve widget structure and replace CreateUnitWidget with EmptyDevicesWidget for better handling of empty states.
This commit is contained in:
@@ -8,9 +8,9 @@ import 'package:syncrow_app/features/scene/bloc/create_scene/create_scene_bloc.d
|
||||
import 'package:syncrow_app/features/scene/bloc/scene_bloc/scene_bloc.dart';
|
||||
import 'package:syncrow_app/features/scene/bloc/scene_bloc/scene_event.dart';
|
||||
import 'package:syncrow_app/features/scene/bloc/smart_scene/smart_scene_select_dart_bloc.dart';
|
||||
import 'package:syncrow_app/features/scene/widgets/empty_devices_widget.dart';
|
||||
import 'package:syncrow_app/features/scene/widgets/scene_view_widget/scene_grid_view.dart';
|
||||
import 'package:syncrow_app/features/scene/widgets/scene_view_widget/scene_header.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/create_unit.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart';
|
||||
import 'package:syncrow_app/utils/context_extension.dart';
|
||||
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
|
||||
@@ -89,8 +89,8 @@ class SceneView extends StatelessWidget {
|
||||
'Scene ${state.sceneName} triggered successfully!');
|
||||
}
|
||||
},
|
||||
child: HomeCubit.getInstance().spaces.isEmpty
|
||||
? const CreateUnitWidget()
|
||||
child: HomeCubit.getInstance().spaces.isEmpty
|
||||
? const EmptyDevicesWidget()
|
||||
: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
@@ -114,11 +114,13 @@ class SceneView extends StatelessWidget {
|
||||
final automationList = state.automationList;
|
||||
|
||||
return pageType
|
||||
? Expanded(
|
||||
? SizedBox(
|
||||
height: context.height * 0.1,
|
||||
child: SceneListview(
|
||||
scenes: scenes,
|
||||
loadingSceneId: state.loadingSceneId,
|
||||
))
|
||||
scenes: scenes,
|
||||
loadingSceneId: state.loadingSceneId,
|
||||
),
|
||||
)
|
||||
: Expanded(
|
||||
child: ListView(
|
||||
children: [
|
||||
|
||||
Reference in New Issue
Block a user