mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2025-04-22 01:10:40 +00:00
Added some RepaintBoundary
This commit is contained in:
parent
4917ee8aef
commit
deb1ac3282
5 changed files with 119 additions and 95 deletions
|
@ -49,6 +49,7 @@ class _MeteringMeasureButtonState extends State<MeteringMeasureButton> {
|
||||||
_isPressed = false;
|
_isPressed = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
child: RepaintBoundary(
|
||||||
child: SizedBox.fromSize(
|
child: SizedBox.fromSize(
|
||||||
size: const Size.square(Dimens.grid72),
|
size: const Size.square(Dimens.grid72),
|
||||||
child: Stack(
|
child: Stack(
|
||||||
|
@ -77,6 +78,7 @@ class _MeteringMeasureButtonState extends State<MeteringMeasureButton> {
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,17 +37,13 @@ class MeteringBottomControls extends StatelessWidget {
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
children: [
|
children: [
|
||||||
if (onSwitchEvSourceType != null)
|
if (onSwitchEvSourceType != null)
|
||||||
Expanded(
|
_SideIcon(
|
||||||
child: Center(
|
onPressed: onSwitchEvSourceType!,
|
||||||
child: IconButton(
|
|
||||||
onPressed: onSwitchEvSourceType,
|
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
context.listen<EvSourceType>() != EvSourceType.camera
|
context.listen<EvSourceType>() != EvSourceType.camera
|
||||||
? Icons.camera_rear
|
? Icons.camera_rear
|
||||||
: Icons.wb_incandescent,
|
: Icons.wb_incandescent,
|
||||||
),
|
),
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
|
@ -56,14 +52,10 @@ class MeteringBottomControls extends StatelessWidget {
|
||||||
isMetering: isMetering,
|
isMetering: isMetering,
|
||||||
onTap: onMeasure,
|
onTap: onMeasure,
|
||||||
),
|
),
|
||||||
Expanded(
|
_SideIcon(
|
||||||
child: Center(
|
|
||||||
child: IconButton(
|
|
||||||
onPressed: onSettings,
|
onPressed: onSettings,
|
||||||
icon: const Icon(Icons.settings),
|
icon: const Icon(Icons.settings),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -72,3 +64,27 @@ class MeteringBottomControls extends StatelessWidget {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class _SideIcon extends StatelessWidget {
|
||||||
|
final Icon icon;
|
||||||
|
final VoidCallback onPressed;
|
||||||
|
|
||||||
|
const _SideIcon({
|
||||||
|
required this.icon,
|
||||||
|
required this.onPressed,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Expanded(
|
||||||
|
child: Center(
|
||||||
|
child: RepaintBoundary(
|
||||||
|
child: IconButton(
|
||||||
|
onPressed: onPressed,
|
||||||
|
icon: icon,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -25,7 +25,8 @@ class CameraControls extends StatelessWidget {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Column(
|
return RepaintBoundary(
|
||||||
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: ExposureOffsetSlider(
|
child: ExposureOffsetSlider(
|
||||||
|
@ -41,6 +42,7 @@ class CameraControls extends StatelessWidget {
|
||||||
onChanged: onZoomChanged,
|
onChanged: onZoomChanged,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,8 @@ class CameraPreview extends StatefulWidget {
|
||||||
class _CameraPreviewState extends State<CameraPreview> {
|
class _CameraPreviewState extends State<CameraPreview> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return AspectRatio(
|
return RepaintBoundary(
|
||||||
|
child: AspectRatio(
|
||||||
aspectRatio: PlatformConfig.cameraPreviewAspectRatio,
|
aspectRatio: PlatformConfig.cameraPreviewAspectRatio,
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Stack(
|
child: Stack(
|
||||||
|
@ -57,6 +58,7 @@ class _CameraPreviewState extends State<CameraPreview> {
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,7 +72,8 @@ class _ReadingValueBuilder extends StatelessWidget {
|
||||||
softWrap: false,
|
softWrap: false,
|
||||||
),
|
),
|
||||||
const SizedBox(height: Dimens.grid4),
|
const SizedBox(height: Dimens.grid4),
|
||||||
AnimatedSwitcher(
|
RepaintBoundary(
|
||||||
|
child: AnimatedSwitcher(
|
||||||
duration: Dimens.switchDuration,
|
duration: Dimens.switchDuration,
|
||||||
child: Text(
|
child: Text(
|
||||||
reading.value,
|
reading.value,
|
||||||
|
@ -81,6 +82,7 @@ class _ReadingValueBuilder extends StatelessWidget {
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
softWrap: false,
|
softWrap: false,
|
||||||
),
|
),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue