mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-15 09:45:22 +00:00
73 lines
2.5 KiB
Dart
73 lines
2.5 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:syncrow_app/features/devices/bloc/devices_cubit.dart';
|
|
import 'package:syncrow_app/features/devices/model/device_model.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';
|
|
import 'package:syncrow_app/utils/resource_manager/strings_manager.dart';
|
|
|
|
class LightInterfaceModes extends StatelessWidget {
|
|
const LightInterfaceModes({
|
|
super.key,
|
|
required this.light,
|
|
});
|
|
|
|
final DeviceModel light;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
BodyMedium(
|
|
text: StringsManager.lightingModes,
|
|
style: context.bodyMedium.copyWith(color: Colors.grey),
|
|
),
|
|
const SizedBox(height: 10),
|
|
Wrap(
|
|
spacing: 25,
|
|
children: List.generate(
|
|
DevicesCubit.get(context).lightModes.length,
|
|
(index) => InkWell(
|
|
// onTap: () => DevicesCubit.get(context).setLightingMode(
|
|
// light, DevicesCubit.get(context).lightModes[index]!),
|
|
child: Column(
|
|
children: [
|
|
Container(
|
|
width: 40,
|
|
height: 40,
|
|
decoration: ShapeDecoration(
|
|
shape: const CircleBorder(),
|
|
color: switch (index) {
|
|
0 => ColorsManager.dozeColor,
|
|
1 => ColorsManager.relaxColor,
|
|
2 => ColorsManager.readingColor,
|
|
3 => ColorsManager.energizingColor,
|
|
_ => ColorsManager.primaryColor,
|
|
},
|
|
),
|
|
),
|
|
BodyMedium(
|
|
text: switch (index) {
|
|
0 => StringsManager.doze,
|
|
1 => StringsManager.relax,
|
|
2 => StringsManager.reading,
|
|
3 => StringsManager.energizing,
|
|
_ => "",
|
|
},
|
|
style: context.bodyMedium.copyWith(
|
|
color: Colors.grey,
|
|
fontSize: 10,
|
|
),
|
|
)
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
const SizedBox(height: 10)
|
|
],
|
|
);
|
|
}
|
|
}
|