restructure light slider widget

This commit is contained in:
Nick Fisher
2024-02-19 20:54:37 +08:00
parent 974f9ea9d9
commit 58c7679857

View File

@@ -68,8 +68,7 @@ class _IblRotationSliderWidgetState extends State<LightSliderWidget> {
lightDir.x, lightDir.x,
lightDir.y, lightDir.y,
lightDir.z, lightDir.z,
castShadows, castShadows);
async: false);
setState(() {}); setState(() {});
} }
@@ -83,8 +82,14 @@ class _IblRotationSliderWidgetState extends State<LightSliderWidget> {
data: ThemeData(platform: TargetPlatform.android), data: ThemeData(platform: TargetPlatform.android),
child: Container( child: Container(
decoration: BoxDecoration(color: Colors.white.withOpacity(0.5)), decoration: BoxDecoration(color: Colors.white.withOpacity(0.5)),
child: Column(children: [ child: SliderTheme(
Slider( data: SliderThemeData(
showValueIndicator: ShowValueIndicator.always,
valueIndicatorTextStyle: TextStyle(color: Colors.black)),
child: Column(mainAxisSize: MainAxisSize.min, children: [
Row(children: [
Expanded(
child: Slider(
label: "POSX", label: "POSX",
value: lightPos.x, value: lightPos.x,
min: -10.0, min: -10.0,
@@ -92,8 +97,9 @@ class _IblRotationSliderWidgetState extends State<LightSliderWidget> {
onChanged: (value) { onChanged: (value) {
lightPos.x = value; lightPos.x = value;
_set(); _set();
}), })),
Slider( Expanded(
child: Slider(
label: "POSY", label: "POSY",
value: lightPos.y, value: lightPos.y,
min: -10.0, min: -10.0,
@@ -101,8 +107,9 @@ class _IblRotationSliderWidgetState extends State<LightSliderWidget> {
onChanged: (value) { onChanged: (value) {
lightPos.y = value; lightPos.y = value;
_set(); _set();
}), })),
Slider( Expanded(
child: Slider(
label: "POSZ", label: "POSZ",
value: lightPos.z, value: lightPos.z,
min: -10.0, min: -10.0,
@@ -110,8 +117,11 @@ class _IblRotationSliderWidgetState extends State<LightSliderWidget> {
onChanged: (value) { onChanged: (value) {
lightPos.z = value; lightPos.z = value;
_set(); _set();
}), }))
Slider( ]),
Row(children: [
Expanded(
child: Slider(
label: "DIRX", label: "DIRX",
value: lightDir.x, value: lightDir.x,
min: -10.0, min: -10.0,
@@ -119,8 +129,9 @@ class _IblRotationSliderWidgetState extends State<LightSliderWidget> {
onChanged: (value) { onChanged: (value) {
lightDir.x = value; lightDir.x = value;
_set(); _set();
}), })),
Slider( Expanded(
child: Slider(
label: "DIRY", label: "DIRY",
value: lightDir.y, value: lightDir.y,
min: -10.0, min: -10.0,
@@ -128,8 +139,9 @@ class _IblRotationSliderWidgetState extends State<LightSliderWidget> {
onChanged: (value) { onChanged: (value) {
lightDir.y = value; lightDir.y = value;
_set(); _set();
}), })),
Slider( Expanded(
child: Slider(
label: "DIRZ", label: "DIRZ",
value: lightDir.z, value: lightDir.z,
min: -10.0, min: -10.0,
@@ -137,7 +149,8 @@ class _IblRotationSliderWidgetState extends State<LightSliderWidget> {
onChanged: (value) { onChanged: (value) {
lightDir.z = value; lightDir.z = value;
_set(); _set();
}), }))
]),
Slider( Slider(
label: "Color", label: "Color",
value: color, value: color,
@@ -177,6 +190,6 @@ class _IblRotationSliderWidgetState extends State<LightSliderWidget> {
_set(); _set();
}) })
]) ])
]))); ]))));
} }
} }