mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
add sensor type icons, and help description icon
This commit is contained in:
@ -6,6 +6,7 @@ import 'package:syncrow_web/pages/device_managment/ceiling_sensor/bloc/event.dar
|
||||
import 'package:syncrow_web/pages/device_managment/ceiling_sensor/bloc/state.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/ceiling_sensor/model/ceiling_sensor_model.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/shared/sensors_widgets/presence_display_data.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/shared/sensors_widgets/presence_space_type.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/shared/sensors_widgets/presence_static_widget.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/shared/sensors_widgets/presence_status.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/shared/sensors_widgets/presence_update_data.dart';
|
||||
@ -99,6 +100,16 @@ class CeilingSensorControls extends StatelessWidget
|
||||
postfix: 'm',
|
||||
description: 'Detection Range',
|
||||
),
|
||||
const PresenceSpaceType(
|
||||
listOfIcons: [
|
||||
Assets.office,
|
||||
Assets.parlour,
|
||||
Assets.dyi,
|
||||
Assets.bathroom,
|
||||
Assets.bedroom,
|
||||
],
|
||||
description: 'Space Type',
|
||||
),
|
||||
PresenceUpdateData(
|
||||
value: model.sensitivity.toDouble(),
|
||||
title: 'Sensitivity:',
|
||||
@ -153,11 +164,11 @@ class CeilingSensorControls extends StatelessWidget
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
context.read<CeilingSensorBloc>().add(GetCeilingDeviceReportsEvent(
|
||||
code: 'presence_record', deviceUuid: device.uuid!));
|
||||
code: '', deviceUuid: device.uuid!));
|
||||
},
|
||||
child: const PresenceStaticWidget(
|
||||
icon: Assets.presenceRecordIcon,
|
||||
description: 'Presence Record',
|
||||
icon: Assets.helpDescriptionIcon,
|
||||
description: 'Help Description',
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -13,7 +13,7 @@ class DeviceControlsContainer extends StatelessWidget {
|
||||
color: ColorsManager.greyColor.withOpacity(0.2),
|
||||
border: Border.all(color: ColorsManager.boxDivider),
|
||||
),
|
||||
padding: const EdgeInsets.all(16),
|
||||
padding: const EdgeInsets.all(12),
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
|
@ -0,0 +1,50 @@
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:syncrow_web/core/extension/build_context_x.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/shared/device_controls_container.dart';
|
||||
import 'package:syncrow_web/utils/color_manager.dart';
|
||||
|
||||
class PresenceSpaceType extends StatelessWidget {
|
||||
const PresenceSpaceType({
|
||||
super.key,
|
||||
required this.listOfIcons,
|
||||
required this.description,
|
||||
});
|
||||
|
||||
final List<String> listOfIcons;
|
||||
final String description;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return DeviceControlsContainer(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
description,
|
||||
style: context.textTheme.bodySmall!.copyWith(
|
||||
color: ColorsManager.blackColor,
|
||||
fontWeight: FontWeight.w400,
|
||||
fontSize: 10,
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
Wrap(
|
||||
runSpacing: 8,
|
||||
spacing: 16,
|
||||
children: [
|
||||
...listOfIcons.map((icon) => SvgPicture.asset(
|
||||
icon,
|
||||
width: 40,
|
||||
height: 40,
|
||||
)),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user