Files
syncrow-app/lib/features/devices/view/widgets/lights/light_interface_slider.dart
Mohammad Salameh 65cbf10485 temp
2024-03-17 09:38:26 +03:00

77 lines
2.5 KiB
Dart

import 'package:flutter/material.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/features/shared_widgets/united_text.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 LightInterfaceSlider extends StatelessWidget {
const LightInterfaceSlider({
super.key,
required this.light,
});
final DeviceModel light;
@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
BodyMedium(
text: StringsManager.dimmerAndColor,
style: context.bodyMedium.copyWith(color: Colors.grey),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: UnitedText(
// value: light.brightness.toString(),
value: '100',
unit: "%",
valueStyle: context.bodyMedium.copyWith(
color: Colors.grey,
fontSize: 26,
),
unitStyle: context.bodyMedium.copyWith(
color: Colors.grey,
fontSize: 16,
),
),
),
Expanded(
flex: 2,
child: SliderTheme(
data: SliderTheme.of(context).copyWith(
thumbColor: ColorsManager.primaryColor,
rangeThumbShape: const RoundRangeSliderThumbShape(
enabledThumbRadius: 9,
),
thumbShape: const RoundSliderThumbShape(
enabledThumbRadius: 9,
),
activeTrackColor: ColorsManager.greyColor,
inactiveTrackColor: ColorsManager.greyColor,
trackHeight: 5,
),
child: Slider(
// value: light.brightness,
value: 100,
onChanged: (value) {
// DevicesCubit.get(context).setBrightness(light, value);
},
min: 0,
max: 100,
),
),
),
],
),
const SizedBox(height: 10),
],
);
}
}