Skip to content

Commit

Permalink
fix(screen): scroll bug
Browse files Browse the repository at this point in the history
  • Loading branch information
charles0122 committed Aug 29, 2024
1 parent f1bca10 commit 57bdeb1
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/src/components/atoms/console.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class Console extends HookWidget {
Widget build(BuildContext context) {
final output = useStream(fvmStdoutProvider);
final lines = useState<List<String>>(['']);
final consoleScrollController = ScrollController();

useEffect(() {
lines.value.insert(0, output.data ?? '');
Expand Down Expand Up @@ -73,7 +74,9 @@ class Console extends HookWidget {
),
),
secondChild: CupertinoScrollbar(
controller: consoleScrollController,
child: ListView.builder(
controller: consoleScrollController,
primary: false,
shrinkWrap: true,
reverse: true,
Expand Down
3 changes: 3 additions & 0 deletions lib/src/modules/fvm/dialogs/cleanup_unused_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import '../fvm_queue.provider.dart';

Future<void> cleanupUnusedDialog(BuildContext context, WidgetRef ref) async {
final unusedVersions = ref.read(unusedVersionProvider);
final scrollController = ScrollController();

if (unusedVersions.isEmpty) {
notify(context
Expand Down Expand Up @@ -52,7 +53,9 @@ Future<void> cleanupUnusedDialog(BuildContext context, WidgetRef ref) async {
content: Container(
constraints: const BoxConstraints(maxWidth: 350, maxHeight: 300),
child: CupertinoScrollbar(
controller: scrollController,
child: SingleChildScrollView(
controller: scrollController,
child: Column(
children: [
Text(
Expand Down
3 changes: 3 additions & 0 deletions lib/src/modules/projects/projects.screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class ProjectsScreen extends HookConsumerWidget {
final settings = ref.watch(settingsProvider);

final filteredProjects = useState(projects);
final projectsScrollController = ScrollController();

Future<void> onRefresh() async {
await ref.read(projectsProvider.notifier).load();
Expand Down Expand Up @@ -99,9 +100,11 @@ class ProjectsScreen extends HookConsumerWidget {
child: projects.isEmpty
? const EmptyProjects()
: CupertinoScrollbar(
controller: projectsScrollController,
child: Padding(
padding: const EdgeInsets.only(left: 10),
child: ResponsiveGridList(
controller: projectsScrollController,
desiredItemWidth: 290,
minSpacing: 0,
children: filteredProjects.value.map((project) {
Expand Down
3 changes: 3 additions & 0 deletions lib/src/modules/sandbox/sandbox.screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class SandboxScreen extends HookConsumerWidget {
final processing = ref.watch(sandboxProvider).processing;

final selectedRelease = useState<ReleaseDto?>(null);
final sandboxScrollController = ScrollController();

useEffect(() {
if (selectedRelease.value == null && releases.all.isNotEmpty) {
Expand Down Expand Up @@ -96,9 +97,11 @@ class SandboxScreen extends HookConsumerWidget {
const Divider(height: 1),
Expanded(
child: CupertinoScrollbar(
controller: sandboxScrollController,
child: Padding(
padding: const EdgeInsets.all(15.0),
child: ListView(
controller: sandboxScrollController,
children: releases.all.map(
(version) {
if (version.name == selectedRelease.value?.name) {
Expand Down
3 changes: 3 additions & 0 deletions lib/src/modules/selected_detail/components/info_drawer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class SelectedDetailDrawer extends ConsumerWidget {
Widget build(BuildContext context, WidgetRef ref) {
final detail = ref.watch(selectedDetailProvider);
final selected = detail?.release;
final detailScrollController = ScrollController();

void onClose() {
// Close drawer if its not large layout
Expand Down Expand Up @@ -82,7 +83,9 @@ class SelectedDetailDrawer extends ConsumerWidget {
),
),
body: CupertinoScrollbar(
controller: detailScrollController,
child: ListView(
controller: detailScrollController,
primary: false,
children: [
ReferenceInfoTile(selected),
Expand Down

0 comments on commit 57bdeb1

Please sign in to comment.