@@ -9,7 +9,7 @@ flexibility, and a very flat code hierarchy than Flex and Stack. Say no to 'nest
9
9
10
10
View [ Flutter Web Online Example] ( https://constraintlayout.flutterfirst.cn )
11
11
12
- ** Flutter ConstraintLayout has extremely high layout performance because it does not require linear
12
+ ** Flutter ConstraintLayout has extremely high layout performance. It does not require linear
13
13
equations to solve. It is recommended to use ConstraintLayout at the top level. For extremely
14
14
complex layout(One thousand child elements, two thousand constraints), layout and drawing total time
15
15
within 5 milliseconds(debug mode on Windows 10,release mode take less time), the frame rate can be
@@ -690,7 +690,7 @@ class CirclePositionExampleState extends State<CirclePositionExample> {
690
690
void initState() {
691
691
super.initState();
692
692
calculateClockAngle();
693
- timer = Timer.periodic(const Duration(seconds: 1), (timer ) {
693
+ timer = Timer.periodic(const Duration(seconds: 1), (_ ) {
694
694
calculateClockAngle();
695
695
});
696
696
}
@@ -739,39 +739,34 @@ class CirclePositionExampleState extends State<CirclePositionExample> {
739
739
translateConstraint: true,
740
740
),
741
741
for (int i = 0; i < 12; i++)
742
- Container(
743
- alignment: Alignment.center,
744
- child: Text(
745
- '${i + 1}',
746
- style: const TextStyle(
747
- fontWeight: FontWeight.bold,
748
- fontSize: 25,
749
- ),
742
+ Text(
743
+ '${i + 1}',
744
+ style: const TextStyle(
745
+ fontWeight: FontWeight.bold,
746
+ fontSize: 25,
750
747
),
751
748
).applyConstraint(
752
- width: 50,
753
- height: 50,
754
749
centerTo: rId(0),
755
750
translate: circleTranslate(
756
- radius: 200 ,
751
+ radius: 205 ,
757
752
angle: (i + 1) * 30,
758
753
),
759
754
),
760
755
for (int i = 0; i < 60; i++)
761
- Transform.rotate(
762
- angle: pi + pi * (i * 6 / 180),
763
- child: Container(
764
- color: Colors.grey,
765
- margin: const EdgeInsets.only(
766
- top: 405,
756
+ if (i % 5 != 0)
757
+ Transform.rotate(
758
+ angle: pi + pi * (i * 6 / 180),
759
+ child: Container(
760
+ color: Colors.grey,
761
+ margin: const EdgeInsets.only(
762
+ top: 405,
763
+ ),
767
764
),
765
+ ).applyConstraint(
766
+ width: 1,
767
+ height: 415,
768
+ centerTo: rId(0),
768
769
),
769
- ).applyConstraint(
770
- width: 1,
771
- height: 415,
772
- centerTo: rId(0),
773
- visibility: i % 5 == 0 ? gone : visible,
774
- ),
775
770
Transform.rotate(
776
771
angle: pi + pi * (hour * 30 / 180),
777
772
alignment: Alignment.topCenter,
0 commit comments