|
|
|
|
|
|
using Unity.UIWidgets.cupertino; |
|
|
|
using Unity.UIWidgets.material; |
|
|
|
using Unity.UIWidgets.painting; |
|
|
|
using Unity.UIWidgets.ui; |
|
|
|
using Unity.UIWidgets.widgets; |
|
|
|
using Color = Unity.UIWidgets.ui.Color; |
|
|
|
|
|
|
|
|
|
|
return new Container( |
|
|
|
height: RaycastableSceneConfig.height, |
|
|
|
color: RaycastableSceneConfig.mainColor, |
|
|
|
child: new Row( |
|
|
|
child: |
|
|
|
new Row( |
|
|
|
new ActionBox( |
|
|
|
name: RaycastableSceneConfig.LightSwitchName, |
|
|
|
onChange: value => |
|
|
|
{ |
|
|
|
LightController.SwitchLight(value); |
|
|
|
}), |
|
|
|
new LightSlider() |
|
|
|
Transform.scale( |
|
|
|
alignment: Alignment.centerLeft, |
|
|
|
scale: RaycastableSceneConfig.scaleSceneBoard, |
|
|
|
child: new ActionBox( |
|
|
|
name: RaycastableSceneConfig.LightSwitchName, |
|
|
|
onChange: value => |
|
|
|
{ |
|
|
|
LightController.SwitchLight(value); |
|
|
|
}) |
|
|
|
), |
|
|
|
new ColorPicker(100), |
|
|
|
// new LightSlider()
|
|
|
|
|
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
return new Row( |
|
|
|
children: new List<Widget>() |
|
|
|
{ |
|
|
|
new Text( |
|
|
|
value? RaycastableSceneConfig.LightOn : RaycastableSceneConfig.LightOff, |
|
|
|
style: RaycastableSceneConfig.fontStyle |
|
|
|
), |
|
|
|
new CupertinoSwitch( |
|
|
|
value: value, |
|
|
|
onChanged: valueIn => |
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
), |
|
|
|
new Text(widget.name, style: RaycastableSceneConfig.fontStyle) |
|
|
|
} |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
return new Row( |
|
|
|
children: new List<Widget>() |
|
|
|
{ |
|
|
|
new Text(RaycastableSceneConfig.LightSliderName, style: RaycastableSceneConfig.fontStyle), |
|
|
|
new Slider( |
|
|
|
value: _currentSliderValue, |
|
|
|
min: 0, |
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
), |
|
|
|
new Text(RaycastableSceneConfig.LightSliderName, style: RaycastableSceneConfig.fontStyle) |
|
|
|
} |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
} |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
class _SliderIndicatorPainter : CustomPainter { |
|
|
|
readonly float position; |
|
|
|
|
|
|
|
_SliderIndicatorPainter(float position) |
|
|
|
{ |
|
|
|
this.position = position; |
|
|
|
} |
|
|
|
|
|
|
|
public void paint(Canvas canvas, Size size) { |
|
|
|
canvas.drawCircle( |
|
|
|
new Offset(position, size.height / 2), 12, new Paint(){color = Colors.black}); |
|
|
|
} |
|
|
|
|
|
|
|
public bool shouldRepaint(CustomPainter oldDelegate) |
|
|
|
{ |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
public bool? hitTest(Offset position) |
|
|
|
{ |
|
|
|
throw new NotImplementedException(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void addListener(VoidCallback listener) |
|
|
|
{ |
|
|
|
throw new NotImplementedException(); |
|
|
|
} |
|
|
|
|
|
|
|
public void removeListener(VoidCallback listener) |
|
|
|
{ |
|
|
|
throw new NotImplementedException(); |
|
|
|
} |
|
|
|
} |