Skip to content

Commit

Permalink
fix: avoid useless LayoutBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexays committed Oct 18, 2023
1 parent bcc20a9 commit 928ce4d
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions lib/src/layer/circle_layer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,10 @@ class CircleLayer extends StatelessWidget {
Widget build(BuildContext context) {
final map = MapCamera.of(context);
return MobileLayerTransformer(
child: LayoutBuilder(
builder: (context, bc) {
final size = Size(bc.maxWidth, bc.maxHeight);
return CustomPaint(
painter: CirclePainter(circles, map),
size: size,
);
},
child: CustomPaint(
painter: CirclePainter(circles, map),
size: Size(map.size.x, map.size.y),
isComplex: true,
),
);
}
Expand Down Expand Up @@ -101,11 +97,8 @@ class CirclePainter extends CustomPainter {
}
pointsBorder[circle.borderColor] ??= {};
pointsBorder[circle.borderColor]![circle.borderStrokeWidth] ??= {};
pointsBorder[circle.borderColor]![circle.borderStrokeWidth]![
realRadius] ??= [];
pointsBorder[circle.borderColor]![circle.borderStrokeWidth]![
realRadius]!
.add(offset);
pointsBorder[circle.borderColor]![circle.borderStrokeWidth]![realRadius] ??= [];
pointsBorder[circle.borderColor]![circle.borderStrokeWidth]![realRadius]!.add(offset);
}
}
}
Expand Down

0 comments on commit 928ce4d

Please sign in to comment.