-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSTRUCTURE.md
More file actions
36 lines (32 loc) · 1.2 KB
/
STRUCTURE.md
File metadata and controls
36 lines (32 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Class CircularSelector
- Initialize required properties (children, childSize, etc.)
- Method: build
- Calculate device dimensions
- Generate positioned children based on calculations
- Return a GestureDetector that handles tap and pan gestures
Class _CircularSelectorState
- Initialize state variables (rotation, animation controller, etc.)
- Method: initState
- Setup animation controller
- Method: dispose
- Dispose animation controller
- Method: calculateGestureAngle
- Calculate angle based on gesture position
- Method: getTappedChildIndex
- Determine which child was tapped based on angle
- Method: animateToTop
- Animate selected child to the top position
- Method: _onPanUpdate
- Handle pan update gesture
- Method: _onPanEnd
- Animate to closest child on pan end
Utility Functions
- Function: getPosition
- Calculate position for each child based on index and rotation
- Function: calculateRotationDiff
- Calculate the shortest rotation difference for animation
Widget Tests
- Test widget builds correctly with required parameters
- Test gesture interactions trigger expected behavior
Unit Tests
- Test utility functions with various inputs