ReadingsContainer -> SizeRenderWidget

This commit is contained in:
Vadim 2023-01-20 23:09:17 +03:00
parent 5bea96669d
commit bdf03f708f
2 changed files with 7 additions and 7 deletions

View file

@ -1,23 +1,23 @@
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
class ReadingsContainer extends SingleChildRenderObjectWidget {
class SizeRenderWidget extends SingleChildRenderObjectWidget {
final ValueChanged<Size>? onLayout;
const ReadingsContainer({
const SizeRenderWidget({
super.key,
super.child,
this.onLayout,
});
@override
RenderReadingsContainer createRenderObject(BuildContext context) => RenderReadingsContainer(onLayout: onLayout);
SizeRenderBox createRenderObject(BuildContext context) => SizeRenderBox(onLayout: onLayout);
}
class RenderReadingsContainer extends RenderProxyBox {
class SizeRenderBox extends RenderProxyBox {
final ValueChanged<Size>? onLayout;
RenderReadingsContainer({this.onLayout});
SizeRenderBox({this.onLayout});
@override
void performLayout() {

View file

@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:lightmeter/platform_config.dart';
import 'package:lightmeter/screens/metering/components/topbar/shape_topbar.dart';
import 'package:lightmeter/screens/metering/components/widget_size_render.dart';
import 'package:lightmeter/screens/metering/components/topbar/components/widget_size_render.dart';
import 'package:lightmeter/generated/l10n.dart';
import 'package:lightmeter/data/models/exposure_pair.dart';
import 'package:lightmeter/data/models/photography_values/iso_value.dart';
@ -65,7 +65,7 @@ class _MeteringTopBarState extends State<MeteringTopBar> {
mainAxisSize: MainAxisSize.min,
children: [
Expanded(
child: ReadingsContainer(
child: SizeRenderWidget(
onLayout: (size) => _onReadingsLayout(size.height),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,