mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-22 23:40:41 +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;
|
||||
});
|
||||
},
|
||||
child: RepaintBoundary(
|
||||
child: SizedBox.fromSize(
|
||||
size: const Size.square(Dimens.grid72),
|
||||
child: Stack(
|
||||
|
@ -77,6 +78,7 @@ class _MeteringMeasureButtonState extends State<MeteringMeasureButton> {
|
|||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,17 +37,13 @@ class MeteringBottomControls extends StatelessWidget {
|
|||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
if (onSwitchEvSourceType != null)
|
||||
Expanded(
|
||||
child: Center(
|
||||
child: IconButton(
|
||||
onPressed: onSwitchEvSourceType,
|
||||
_SideIcon(
|
||||
onPressed: onSwitchEvSourceType!,
|
||||
icon: Icon(
|
||||
context.listen<EvSourceType>() != EvSourceType.camera
|
||||
? Icons.camera_rear
|
||||
: Icons.wb_incandescent,
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
else
|
||||
const Spacer(),
|
||||
|
@ -56,14 +52,10 @@ class MeteringBottomControls extends StatelessWidget {
|
|||
isMetering: isMetering,
|
||||
onTap: onMeasure,
|
||||
),
|
||||
Expanded(
|
||||
child: Center(
|
||||
child: IconButton(
|
||||
_SideIcon(
|
||||
onPressed: onSettings,
|
||||
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
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
return RepaintBoundary(
|
||||
child: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: ExposureOffsetSlider(
|
||||
|
@ -41,6 +42,7 @@ class CameraControls extends StatelessWidget {
|
|||
onChanged: onZoomChanged,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,8 @@ class CameraPreview extends StatefulWidget {
|
|||
class _CameraPreviewState extends State<CameraPreview> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AspectRatio(
|
||||
return RepaintBoundary(
|
||||
child: AspectRatio(
|
||||
aspectRatio: PlatformConfig.cameraPreviewAspectRatio,
|
||||
child: Center(
|
||||
child: Stack(
|
||||
|
@ -57,6 +58,7 @@ class _CameraPreviewState extends State<CameraPreview> {
|
|||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -72,7 +72,8 @@ class _ReadingValueBuilder extends StatelessWidget {
|
|||
softWrap: false,
|
||||
),
|
||||
const SizedBox(height: Dimens.grid4),
|
||||
AnimatedSwitcher(
|
||||
RepaintBoundary(
|
||||
child: AnimatedSwitcher(
|
||||
duration: Dimens.switchDuration,
|
||||
child: Text(
|
||||
reading.value,
|
||||
|
@ -81,6 +82,7 @@ class _ReadingValueBuilder extends StatelessWidget {
|
|||
overflow: TextOverflow.ellipsis,
|
||||
softWrap: false,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue