删除不必要的hook

main
落雨楓 2 years ago
parent 88fb284a6c
commit ac44260f2c

@ -30,10 +30,6 @@ class _ResponsivePairState extends State<ResponsivePair> {
@override
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) {
refreshSize();
});
}
void refreshSize() {
@ -87,10 +83,18 @@ class _ResponsivePairState extends State<ResponsivePair> {
);
} else {
if (_isRow) {
var i = -1;
var children = widget.children.map((child) {
i++;
if (i != 0) {
return Flexible(child: child);
}
return child;
}).toList();
inner = Row(
mainAxisAlignment: widget.rowMainAxisAlignment,
crossAxisAlignment: widget.rowCrossAxisAlignment,
children: widget.children,
children: children,
);
} else {
inner = Column(
@ -108,10 +112,10 @@ class _ResponsivePairState extends State<ResponsivePair> {
}
}
typedef OnWidgetSizeChange = void Function(Size size, int id);
typedef WidgetSizeChangeCallback = void Function(Size size, int id);
class WidgetSizeRenderObject extends RenderProxyBox {
final OnWidgetSizeChange onSizeChange;
final WidgetSizeChangeCallback onSizeChange;
final int id;
Size? currentSize;
@ -137,7 +141,7 @@ class WidgetSizeRenderObject extends RenderProxyBox {
}
class WidgetSizeOffsetWrapper extends SingleChildRenderObjectWidget {
final OnWidgetSizeChange onSizeChange;
final WidgetSizeChangeCallback onSizeChange;
final int id;
const WidgetSizeOffsetWrapper({
Loading…
Cancel
Save