Skip to content

Commit 354639c

Browse files
committed
analyze issues fixed
1 parent 4708bf5 commit 354639c

File tree

2 files changed

+6
-16
lines changed

2 files changed

+6
-16
lines changed

example/lib/main_temp.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ class _MyHomePageState extends State<MyHomePage>
180180
child: ListView.builder(
181181
itemCount: imageList.length,
182182
itemBuilder: (context, index) => GFStickyHeader(
183-
// enableHeaderOverlap: true,
183+
enableHeaderOverlap: true,
184184
direction: Axis.vertical,
185185
// stickyContentPosition: GFPosition.end,
186186
stickyContent: Container(
@@ -198,10 +198,10 @@ class _MyHomePageState extends State<MyHomePage>
198198
),
199199
),
200200
content: Container(
201-
height: 100,
201+
// height: 100,
202202
width: 200,
203203
child: Image.network(imageList[index],
204-
fit: BoxFit.cover,
204+
fit: BoxFit.cover, height: 200,
205205
),
206206
),
207207
)

lib/components/sticky_header/render_gf_sticky_header.dart

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -150,26 +150,20 @@ class RenderGFStickyHeader extends RenderBox
150150

151151
final double stickyContentBodyOffset = getHeaderTileStuckOffset();
152152

153-
int totalFlex = 0;
154-
int totalChildren = 0;
153+
155154
assert(constraints != null);
156-
final double maxMainSize = _direction == Axis.horizontal
157-
? constraints.maxWidth
158-
: constraints.maxHeight;
159-
final bool canFlex = maxMainSize < double.infinity;
160155

161156
double crossSize = 0;
162157
double allocatedSize = 0;
163158
RenderBox child = firstChild;
164-
RenderBox lastFlexChild;
159+
// ignore: unused_local_variable
160+
int totalChildren = 0;
165161
while (child != null) {
166162
// ignore: avoid_as
167163
final FlexParentData childParentData = child.parentData as FlexParentData;
168164
totalChildren++;
169165
final int flex = _getFlex(child);
170166
if (flex > 0) {
171-
totalFlex += childParentData.flex;
172-
lastFlexChild = child;
173167
} else {
174168
BoxConstraints innerConstraints;
175169
switch (_direction) {
@@ -190,7 +184,6 @@ class RenderGFStickyHeader extends RenderBox
190184

191185
final double idealSize = allocatedSize;
192186
double actualSize;
193-
double actualSizeDelta;
194187
switch (_direction) {
195188
case Axis.horizontal:
196189
size = constraints.constrain(Size(idealSize, crossSize));
@@ -203,9 +196,6 @@ class RenderGFStickyHeader extends RenderBox
203196
crossSize = size.width;
204197
break;
205198
}
206-
actualSizeDelta = actualSize - allocatedSize;
207-
// _overflow = math.max(0, -actualSizeDelta);
208-
final double remainingSpace = math.max(0, actualSizeDelta);
209199
const double leadingSpace = 0;
210200
const double betweenSpace = 0;
211201
const bool flipMainAxis = !true;

0 commit comments

Comments
 (0)