Skip to content

Commit 927f42b

Browse files
authored
feat: add ScrollbarVisibilityWidget for enhanced scrolling experience in registration setup panel (#2247)
1 parent 0a6f9d0 commit 927f42b

File tree

1 file changed

+51
-26
lines changed
  • catalyst_voices/apps/voices/lib/pages/registration/create_base_profile/stage

1 file changed

+51
-26
lines changed

catalyst_voices/apps/voices/lib/pages/registration/create_base_profile/stage/setup_panel.dart

Lines changed: 51 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,11 @@ import 'package:catalyst_voices_shared/catalyst_voices_shared.dart';
88
import 'package:catalyst_voices_view_models/catalyst_voices_view_models.dart';
99
import 'package:flutter/material.dart';
1010

11-
class SetupPanel extends StatelessWidget {
11+
class SetupPanel extends StatefulWidget {
1212
const SetupPanel({super.key});
1313

1414
@override
15-
Widget build(BuildContext context) {
16-
return Column(
17-
crossAxisAlignment: CrossAxisAlignment.start,
18-
children: [
19-
const SizedBox(height: 24),
20-
const _Title(),
21-
Expanded(
22-
child: FocusScope(
23-
child: ListView(
24-
padding: const EdgeInsets.symmetric(vertical: 24),
25-
children: const [
26-
_DisplayNameSelector(),
27-
SizedBox(height: 24),
28-
_EmailSelector(),
29-
],
30-
),
31-
),
32-
),
33-
const SizedBox(height: 24),
34-
const _IdeascaleInfoCard(),
35-
const SizedBox(height: 24),
36-
const _NavigationSelector(),
37-
],
38-
);
39-
}
15+
State<SetupPanel> createState() => _SetupPanelState();
4016
}
4117

4218
class _DisplayNameSelector extends StatelessWidget {
@@ -186,6 +162,55 @@ class _NavigationSelector extends StatelessWidget {
186162
}
187163
}
188164

165+
class _SetupPanelState extends State<SetupPanel> {
166+
late final ScrollController _scrollController;
167+
168+
@override
169+
Widget build(BuildContext context) {
170+
return Column(
171+
crossAxisAlignment: CrossAxisAlignment.start,
172+
children: [
173+
const SizedBox(height: 24),
174+
const _Title(),
175+
Expanded(
176+
child: FocusScope(
177+
child: VoicesScrollbar(
178+
controller: _scrollController,
179+
alwaysVisible: true,
180+
padding: const EdgeInsets.only(left: 10),
181+
child: ListView(
182+
controller: _scrollController,
183+
padding: const EdgeInsets.symmetric(vertical: 24),
184+
children: const [
185+
_DisplayNameSelector(),
186+
SizedBox(height: 24),
187+
_EmailSelector(),
188+
],
189+
),
190+
),
191+
),
192+
),
193+
const SizedBox(height: 24),
194+
const _IdeascaleInfoCard(),
195+
const SizedBox(height: 24),
196+
const _NavigationSelector(),
197+
],
198+
);
199+
}
200+
201+
@override
202+
void dispose() {
203+
_scrollController.dispose();
204+
super.dispose();
205+
}
206+
207+
@override
208+
void initState() {
209+
super.initState();
210+
_scrollController = ScrollController();
211+
}
212+
}
213+
189214
class _Title extends StatelessWidget {
190215
const _Title();
191216

0 commit comments

Comments
 (0)