Skip to content

Commit bdeb835

Browse files
committed
Update dart sdk constraint
1 parent 5fa2acd commit bdeb835

20 files changed

+105
-189
lines changed

boxy/lib/src/axis_utils.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -528,12 +528,11 @@ class AxisSizedBox extends SizedBox {
528528
/// to indicate that the size of the box should not be constrained in
529529
/// the corresponding dimension.
530530
const AxisSizedBox({
531-
Key? key,
531+
super.key,
532532
required Axis axis,
533533
double? cross,
534534
double? main,
535535
}) : super(
536-
key: key,
537536
width: axis == Axis.vertical ? cross : main,
538537
height: axis == Axis.vertical ? main : cross,
539538
);

boxy/lib/src/boxy/box_child.dart

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,12 @@ class BoxyChild extends BaseBoxyChild {
3838
/// this should not be used directly, instead access one with
3939
/// [BoxyDelegate.getChild].
4040
BoxyChild({
41-
required Object id,
42-
required InflatingRenderObjectMixin parent,
43-
RenderBox? render,
44-
Widget? widget,
45-
Element? context,
46-
}) : super(
47-
id: id,
48-
parent: parent,
49-
render: render,
50-
widget: widget,
51-
context: context,
52-
);
41+
required super.id,
42+
required super.parent,
43+
RenderBox? super.render,
44+
super.widget,
45+
super.context,
46+
});
5347

5448
/// The [RenderBox] representing this child.
5549
///

boxy/lib/src/boxy/box_delegate.dart

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -366,12 +366,9 @@ abstract class BoxBoxyDelegate<LayoutData extends Object>
366366
/// Constructs a BoxyDelegate with optional [relayout] and [repaint]
367367
/// [Listenable]s.
368368
BoxBoxyDelegate({
369-
Listenable? relayout,
370-
Listenable? repaint,
371-
}) : super(
372-
relayout: relayout,
373-
repaint: repaint,
374-
);
369+
super.relayout,
370+
super.repaint,
371+
});
375372
}
376373

377374
/// A delegate that controls the layout and paint of child widgets, used by
@@ -582,12 +579,9 @@ abstract class BoxyDelegate<LayoutData extends Object>
582579
/// Constructs a BoxyDelegate with optional [relayout] and [repaint]
583580
/// [Listenable]s.
584581
BoxyDelegate({
585-
Listenable? relayout,
586-
Listenable? repaint,
587-
}) : super(
588-
relayout: relayout,
589-
repaint: repaint,
590-
);
582+
super.relayout,
583+
super.repaint,
584+
});
591585

592586
@override
593587
Size layout() {

boxy/lib/src/boxy/custom_boxy.dart

Lines changed: 14 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,10 @@ abstract class CustomBoxy extends LayoutInflatingWidget {
7474
}) = _CustomBoxy;
7575

7676
const CustomBoxy._({
77-
Key? key,
78-
List<Widget> children = const <Widget>[],
77+
super.key,
78+
super.children,
7979
required this.childFactory,
80-
}) : super(
81-
key: key,
82-
children: children,
83-
);
80+
});
8481

8582
/// Constructs a CustomBoxy with [BoxBoxyDelegate] that can manage both
8683
/// [BoxyChild] and [SliverBoxyChild] children.
@@ -163,15 +160,10 @@ class _CustomBoxy extends CustomBoxy {
163160

164161
/// Constructs a CustomBoxy with a delegate and optional set of children.
165162
const _CustomBoxy({
166-
Key? key,
163+
super.key,
167164
required this.delegate,
168-
List<Widget> children = const <Widget>[],
169-
InflatedChildHandleFactory childFactory = CustomBoxy.defaultChildFactory,
170-
}) : super._(
171-
key: key,
172-
children: children,
173-
childFactory: childFactory,
174-
);
165+
super.children,
166+
}) : super._(childFactory: CustomBoxy.defaultChildFactory);
175167

176168
@override
177169
RenderBoxy createRenderObject(BuildContext context) {
@@ -191,15 +183,11 @@ class _BoxCustomBoxy extends CustomBoxy {
191183
final BoxBoxyDelegate delegate;
192184

193185
const _BoxCustomBoxy({
194-
Key? key,
186+
super.key,
195187
required this.delegate,
196-
List<Widget> children = const <Widget>[],
197-
InflatedChildHandleFactory childFactory = CustomBoxy.defaultChildFactory,
198-
}) : super._(
199-
key: key,
200-
children: children,
201-
childFactory: childFactory,
202-
);
188+
super.children,
189+
super.childFactory = CustomBoxy.defaultChildFactory,
190+
}) : super._();
203191

204192
@override
205193
RenderBoxy createRenderObject(BuildContext context) {
@@ -219,15 +207,11 @@ class _SliverCustomBoxy extends CustomBoxy {
219207
final SliverBoxyDelegate delegate;
220208

221209
const _SliverCustomBoxy({
222-
Key? key,
210+
super.key,
223211
required this.delegate,
224-
List<Widget> children = const <Widget>[],
225-
InflatedChildHandleFactory childFactory = CustomBoxy.defaultChildFactory,
226-
}) : super._(
227-
key: key,
228-
children: children,
229-
childFactory: childFactory,
230-
);
212+
super.children,
213+
super.childFactory = CustomBoxy.defaultChildFactory,
214+
}) : super._();
231215

232216
@override
233217
RenderSliverBoxy createRenderObject(BuildContext context) {

boxy/lib/src/boxy/custom_boxy_base.dart

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -635,19 +635,12 @@ class BoxyLayerContext {
635635
class BaseBoxyChild extends InflatedChildHandle {
636636
/// Constructs a handle to children managed by [RenderBoxyMixin] clients.
637637
BaseBoxyChild({
638-
required Object id,
639-
required InflatingRenderObjectMixin parent,
640-
RenderObject? render,
641-
Element? context,
642-
Widget? widget,
643-
}) : assert(render == null || render.parentData != null),
644-
super(
645-
id: id,
646-
parent: parent,
647-
render: render,
648-
widget: widget,
649-
context: context,
650-
);
638+
required super.id,
639+
required super.parent,
640+
super.render,
641+
super.context,
642+
super.widget,
643+
}) : assert(render == null || render.parentData != null);
651644

652645
bool _ignore = false;
653646

@@ -1239,20 +1232,16 @@ class BoxyId<T extends Object> extends ParentDataWidget<BaseBoxyParentData> {
12391232
/// Constructs a BoxyData with an optional id, data, and child.
12401233
const BoxyId({
12411234
this.id,
1242-
Key? key,
1235+
super.key,
12431236
bool? hasData,
12441237
T? data,
1245-
required Widget child,
1238+
required super.child,
12461239
bool alwaysRelayout = true,
12471240
bool alwaysRepaint = true,
12481241
}) : hasData = hasData ?? data != null,
12491242
_data = data,
12501243
_alwaysRelayout = alwaysRelayout,
1251-
_alwaysRepaint = alwaysRepaint,
1252-
super(
1253-
key: key,
1254-
child: child,
1255-
);
1244+
_alwaysRepaint = alwaysRepaint;
12561245

12571246
/// The data to provide to the parent.
12581247
T get data {

boxy/lib/src/boxy/inflating_element.dart

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ abstract class LayoutInflatingWidget extends RenderObjectWidget {
1818
/// Base constructor for a widget that can inflate arbitrary widgets during
1919
/// layout.
2020
const LayoutInflatingWidget({
21-
Key? key,
21+
super.key,
2222
this.children = const [],
23-
}) : super(key: key);
23+
});
2424

2525
/// The list of children this boxy is a parent of.
2626
final List<Widget> children;
@@ -366,9 +366,8 @@ mixin InflatingRenderObjectMixin<
366366
/// * [InflatingRenderObjectMixin]
367367
class InflatingElement extends RenderObjectElement {
368368
/// Constructs an InflatingElement using the specified widget.
369-
InflatingElement(LayoutInflatingWidget widget)
370-
: assert(!debugChildrenHaveDuplicateKeys(widget, widget.children)),
371-
super(widget);
369+
InflatingElement(LayoutInflatingWidget super.widget)
370+
: assert(!debugChildrenHaveDuplicateKeys(widget, widget.children));
372371

373372
@override
374373
LayoutInflatingWidget get widget => super.widget as LayoutInflatingWidget;

boxy/lib/src/boxy/sliver_child.dart

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import 'package:flutter/rendering.dart';
2-
import 'package:flutter/widgets.dart';
32

43
import '../axis_utils.dart';
54
import '../sliver_offset.dart';
@@ -60,18 +59,12 @@ class SliverBoxyChild extends BaseBoxyChild {
6059
/// this should not be used directly, instead access one with
6160
/// [BoxyDelegate.getChild].
6261
SliverBoxyChild({
63-
required Object id,
64-
required InflatingRenderObjectMixin parent,
65-
RenderSliver? render,
66-
Element? context,
67-
Widget? widget,
68-
}) : super(
69-
id: id,
70-
parent: parent,
71-
render: render,
72-
context: context,
73-
widget: widget,
74-
);
62+
required super.id,
63+
required super.parent,
64+
RenderSliver? super.render,
65+
super.context,
66+
super.widget,
67+
});
7568

7669
/// The [RenderBox] representing this child.
7770
///

boxy/lib/src/boxy/sliver_delegate.dart

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -222,12 +222,9 @@ abstract class SliverBoxyDelegate<LayoutData extends Object>
222222
/// Constructs a BoxyDelegate with optional [relayout] and [repaint]
223223
/// [Listenable]s.
224224
SliverBoxyDelegate({
225-
Listenable? relayout,
226-
Listenable? repaint,
227-
}) : super(
228-
relayout: relayout,
229-
repaint: repaint,
230-
);
225+
super.relayout,
226+
super.repaint,
227+
});
231228

232229
@override
233230
RenderSliverBoxy<BaseBoxyChild> get render =>
@@ -273,7 +270,7 @@ typedef _HitTestCallback = bool Function(
273270
/// [SliverHitTestResult] is missing [BoxHitTestResult.addWithPaintTransform],
274271
/// [HitTestResult.pushTransform] is also protected, oof.
275272
class _SliverBoxyHitTestResult extends SliverHitTestResult {
276-
_SliverBoxyHitTestResult.wrap(HitTestResult result) : super.wrap(result);
273+
_SliverBoxyHitTestResult.wrap(super.result) : super.wrap();
277274

278275
bool addWithRawTransform({
279276
required Matrix4? transform,

0 commit comments

Comments
 (0)