@@ -22,33 +22,41 @@ class TaskReviewScreen extends ConsumerWidget {
22
22
shape: const RoundedRectangleBorder (
23
23
borderRadius: BorderRadius .vertical (top: Radius .circular (22 )),
24
24
),
25
+ isScrollControlled: true ,
25
26
builder: (_) => SafeArea (
26
- child: Column (
27
- mainAxisSize: MainAxisSize .min,
28
- children: [
29
- for (var track in trackList)
30
- ListTile (
31
- title: Text (
32
- track.name,
33
- style: AppTextStyles .body (context).copyWith (color: Colors .white),
34
- ),
35
- onTap: () {
36
- ref.read (selectedTrackProvider.notifier).state = track.id;
37
- ref.read (taskReviewControllerProvider.notifier).fetchTasksForTrack (track.id);
38
- Navigator .pop (context);
39
- },
40
- ),
41
- const Divider (color: Colors .white10),
42
- ListTile (
43
- title: Center (
44
- child: Text (
45
- 'Cancel' ,
46
- style: AppTextStyles .body (context).copyWith (color: Colors .redAccent),
27
+ child: ConstrainedBox (
28
+ constraints: BoxConstraints (
29
+ maxHeight: MediaQuery .of (context).size.height * 0.7 ,
30
+ ),
31
+ child: SingleChildScrollView (
32
+ child: Column (
33
+ mainAxisSize: MainAxisSize .min,
34
+ children: [
35
+ for (var track in trackList)
36
+ ListTile (
37
+ title: Text (
38
+ track.name,
39
+ style: AppTextStyles .body (context).copyWith (color: Colors .white),
40
+ ),
41
+ onTap: () {
42
+ ref.read (selectedTrackProvider.notifier).state = track.id;
43
+ ref.read (taskReviewControllerProvider.notifier).fetchTasksForTrack (track.id);
44
+ Navigator .pop (context);
45
+ },
46
+ ),
47
+ const Divider (color: Colors .white10),
48
+ ListTile (
49
+ title: Center (
50
+ child: Text (
51
+ 'Cancel' ,
52
+ style: AppTextStyles .body (context).copyWith (color: Colors .redAccent),
53
+ ),
54
+ ),
55
+ onTap: () => Navigator .pop (context),
47
56
),
48
- ),
49
- onTap: () => Navigator .pop (context),
57
+ ],
50
58
),
51
- ] ,
59
+ ) ,
52
60
),
53
61
),
54
62
);
@@ -96,90 +104,92 @@ class TaskReviewScreen extends ConsumerWidget {
96
104
),
97
105
],
98
106
),
99
- child: Row (
100
- mainAxisAlignment: MainAxisAlignment .center,
101
- children: [
102
- ElevatedButton (
103
- onPressed: () {
104
- ref.read (activeTaskFilterProvider.notifier).state = 'handin' ;
105
- },
106
- style: ElevatedButton .styleFrom (
107
- backgroundColor: activeFilter == 'handin'
108
- ? AppColors .primary.withOpacity (0.12 )
109
- : Colors .transparent,
110
- elevation: 0 ,
111
- shadowColor: Colors .transparent,
112
- shape: RoundedRectangleBorder (
113
- borderRadius: BorderRadius .circular (10 ),
114
- ),
115
- padding: const EdgeInsets .symmetric (horizontal: 16 , vertical: 10 ),
116
- ),
117
- child: Text (
118
- 'Hand in' ,
119
- style: AppTextStyles .caption (context).copyWith (
120
- color: activeFilter == 'handin'
121
- ? AppColors .primary
122
- : Colors .white.withOpacity (0.7 ),
123
- fontWeight: FontWeight .w500,
124
- ),
125
- ),
126
- ),
127
- SizedBox (width: screenWidth * 0.02 ),
128
- ElevatedButton (
129
- onPressed: () {
130
- ref.read (activeTaskFilterProvider.notifier).state = 'submissions' ;
131
- },
132
- style: ElevatedButton .styleFrom (
133
- backgroundColor: activeFilter == 'submissions'
134
- ? AppColors .primary.withOpacity (0.12 )
135
- : Colors .transparent,
136
- elevation: 0 ,
137
- shadowColor: Colors .transparent,
138
- shape: RoundedRectangleBorder (
139
- borderRadius: BorderRadius .circular (10 ),
107
+ child: SingleChildScrollView (
108
+ scrollDirection: Axis .horizontal,
109
+ child: Row (
110
+ children: [
111
+ ElevatedButton (
112
+ onPressed: () {
113
+ ref.read (activeTaskFilterProvider.notifier).state = 'handin' ;
114
+ },
115
+ style: ElevatedButton .styleFrom (
116
+ backgroundColor: activeFilter == 'handin'
117
+ ? AppColors .primary.withOpacity (0.12 )
118
+ : Colors .transparent,
119
+ elevation: 0 ,
120
+ shadowColor: Colors .transparent,
121
+ shape: RoundedRectangleBorder (
122
+ borderRadius: BorderRadius .circular (10 ),
123
+ ),
124
+ padding: const EdgeInsets .symmetric (horizontal: 16 , vertical: 10 ),
140
125
),
141
- padding: const EdgeInsets .symmetric (horizontal: 16 , vertical: 10 ),
142
- ),
143
- child: Text (
144
- 'Submissions' ,
145
- style: AppTextStyles .caption (context).copyWith (
146
- color: activeFilter == 'submissions'
147
- ? AppColors .primary
148
- : Colors .white.withOpacity (0.7 ),
149
- fontWeight: FontWeight .w500,
126
+ child: Text (
127
+ 'Hand in' ,
128
+ style: AppTextStyles .caption (context).copyWith (
129
+ color: activeFilter == 'handin'
130
+ ? AppColors .primary
131
+ : Colors .white.withOpacity (0.7 ),
132
+ fontWeight: FontWeight .w500,
133
+ ),
150
134
),
151
135
),
152
- ),
153
- SizedBox (width: screenWidth * 0.02 ),
154
- GestureDetector (
155
- onTap: () => _showTrackSelector (context, ref),
156
- child: Container (
157
- padding: const EdgeInsets .symmetric (horizontal: 16 , vertical: 10 ),
158
- decoration: BoxDecoration (
159
- color: Colors .white.withOpacity (0.03 ),
160
- borderRadius: BorderRadius .circular (10 ),
161
- border: Border .all (color: Colors .white.withOpacity (0.06 )),
136
+ SizedBox (width: screenWidth * 0.02 ),
137
+ ElevatedButton (
138
+ onPressed: () {
139
+ ref.read (activeTaskFilterProvider.notifier).state = 'submissions' ;
140
+ },
141
+ style: ElevatedButton .styleFrom (
142
+ backgroundColor: activeFilter == 'submissions'
143
+ ? AppColors .primary.withOpacity (0.12 )
144
+ : Colors .transparent,
145
+ elevation: 0 ,
146
+ shadowColor: Colors .transparent,
147
+ shape: RoundedRectangleBorder (
148
+ borderRadius: BorderRadius .circular (10 ),
149
+ ),
150
+ padding: const EdgeInsets .symmetric (horizontal: 16 , vertical: 10 ),
162
151
),
163
152
child: Text (
164
- tracks.when (
165
- data: (list) {
166
- final selected = list.firstWhere (
167
- (t) => t.id == selectedTrackId,
168
- orElse: () => list[0 ],
169
- );
170
- return selected.name;
171
- },
172
- loading: () => 'Loading...' ,
173
- error: (_, __) => 'Error' ,
174
- ),
153
+ 'Submissions' ,
175
154
style: AppTextStyles .caption (context).copyWith (
176
- color: Colors .white.withOpacity (0.9 ),
155
+ color: activeFilter == 'submissions'
156
+ ? AppColors .primary
157
+ : Colors .white.withOpacity (0.7 ),
177
158
fontWeight: FontWeight .w500,
178
159
),
179
160
),
180
161
),
181
- ),
182
- ],
162
+ SizedBox (width: screenWidth * 0.02 ),
163
+ GestureDetector (
164
+ onTap: () => _showTrackSelector (context, ref),
165
+ child: Container (
166
+ padding: const EdgeInsets .symmetric (horizontal: 16 , vertical: 10 ),
167
+ decoration: BoxDecoration (
168
+ color: Colors .white.withOpacity (0.03 ),
169
+ borderRadius: BorderRadius .circular (10 ),
170
+ border: Border .all (color: Colors .white.withOpacity (0.06 )),
171
+ ),
172
+ child: Text (
173
+ tracks.when (
174
+ data: (list) {
175
+ final selected = list.firstWhere (
176
+ (t) => t.id == selectedTrackId,
177
+ orElse: () => list[0 ],
178
+ );
179
+ return selected.name;
180
+ },
181
+ loading: () => 'Loading...' ,
182
+ error: (_, __) => 'Error' ,
183
+ ),
184
+ style: AppTextStyles .caption (context).copyWith (
185
+ color: Colors .white.withOpacity (0.9 ),
186
+ fontWeight: FontWeight .w500,
187
+ ),
188
+ ),
189
+ ),
190
+ ),
191
+ ],
192
+ ),
183
193
),
184
194
),
185
195
0 commit comments