mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-15 17:47:28 +00:00
54 lines
1.6 KiB
Dart
54 lines
1.6 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:syncrow_app/features/scene/model/scenes_model.dart';
|
|
import 'package:syncrow_app/features/scene/widgets/scene_view_widget/scene_grid_view.dart';
|
|
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart';
|
|
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
|
|
|
|
class RoutinesExpansionTile extends StatelessWidget {
|
|
const RoutinesExpansionTile({
|
|
super.key,
|
|
required this.title,
|
|
required this.emptyRoutinesMessage,
|
|
required this.routines,
|
|
required this.loadingStates,
|
|
this.loadingSceneId,
|
|
});
|
|
final String title;
|
|
final String emptyRoutinesMessage;
|
|
final List<ScenesModel> routines;
|
|
final Map<String, bool> loadingStates;
|
|
final String? loadingSceneId;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return ExpansionTile(
|
|
tilePadding: const EdgeInsets.symmetric(
|
|
horizontal: 6,
|
|
),
|
|
initiallyExpanded: true,
|
|
iconColor: ColorsManager.grayColor,
|
|
title: BodyMedium(
|
|
text: title,
|
|
),
|
|
childrenPadding: EdgeInsetsDirectional.only(bottom: 10),
|
|
children: [
|
|
Visibility(
|
|
visible: routines.isNotEmpty,
|
|
replacement: Center(
|
|
child: BodyMedium(
|
|
text: emptyRoutinesMessage,
|
|
textAlign: TextAlign.center,
|
|
),
|
|
),
|
|
child: SceneGrid(
|
|
scenes: routines,
|
|
loadingSceneId: loadingSceneId,
|
|
disablePlayButton: false,
|
|
loadingStates: loadingStates,
|
|
),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|