Skip to content

Commit 7054061

Browse files
committed
remove cache support
1 parent 9cea82c commit 7054061

File tree

6 files changed

+47
-584
lines changed

6 files changed

+47
-584
lines changed

README.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -563,14 +563,6 @@ class OffBuildExample extends StatelessWidget {
563563
wrapContent will be re-layout. And since the constraints passed to other child elements won't
564564
change, no real re-layout will be triggered.
565565

566-
4. By default, constraints are not recalculated during layout if the constraints of child elements
567-
do not change. Even the constraint computation is extremely fast. But when the ListView is swiped
568-
quickly, constraints are calculated for each item layout process, even though the constraints of
569-
these items may not change. This is not necessary. At this point ChildConstraintsCache can be
570-
used to optimize it so that constraints for entries of the same type are computed only once.
571-
Refer to example/complex_list.dart. Constraints can also be calculated ahead of time so that they
572-
don't need to be calculated during layout. Refer to example/preprocess_complex_list.dart.
573-
574566
# Support me
575567

576568
If it helps you a lot, consider sponsoring me a cup of milk tea.

example/complex_list.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ class ComplexListExample extends StatelessWidget {
2121
Colors.pink,
2222
];
2323

24-
ChildConstraintsCache childConstraintsCache = ChildConstraintsCache();
25-
2624
return Scaffold(
2725
appBar: const CustomAppBar(
2826
title: 'ComplexList',
@@ -41,8 +39,6 @@ class ComplexListExample extends StatelessWidget {
4139
);
4240
}
4341
return ConstraintLayout(
44-
useCacheConstraints: true,
45-
childConstraintsCache: childConstraintsCache,
4642
children: [
4743
Container(
4844
color: colors[index % 6],

example/home.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import 'badge.dart';
44
import 'barrier.dart';
55
import 'complex_list.dart';
66
import 'guideline.dart';
7-
import 'preprocess_complex_list.dart';
87
import 'summary.dart';
98

109
class ExampleHome extends StatelessWidget {
@@ -38,9 +37,6 @@ class ExampleHome extends StatelessWidget {
3837
button('ComplexList', () {
3938
push(context, const ComplexListExample());
4039
}),
41-
button('PreprocessComplexList', () {
42-
push(context, const PreprocessComplexListExample());
43-
}),
4440
button('Badge', () {
4541
push(context, const BadgeExample());
4642
}),

example/preprocess_complex_list.dart

Lines changed: 0 additions & 195 deletions
This file was deleted.

0 commit comments

Comments
 (0)