Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pull-down refresh #1292

Merged
merged 1 commit into from
Sep 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 22 additions & 12 deletions mobile/lib/features/wallet/wallet_screen.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
import 'package:get_10101/common/amount_text.dart';
Expand Down Expand Up @@ -224,20 +225,29 @@ class _WalletScreenState extends State<WalletScreen> {
height: 5,
),
Expanded(
child: ListView.builder(
shrinkWrap: true,
physics: const ClampingScrollPhysics(),
itemCount: walletChangeNotifier.walletInfo.history.length + 1,
itemBuilder: (BuildContext context, int index) {
// Spacer at the bottom of the list
if (index == walletChangeNotifier.walletInfo.history.length) {
return listBottomScrollSpace;
}
child: ScrollConfiguration(
behavior: ScrollConfiguration.of(context).copyWith(
dragDevices: {
PointerDeviceKind.touch,
PointerDeviceKind.mouse,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes it possible on desktop, which is a nice QoL feature for development

},
),
child: ListView.builder(
shrinkWrap: true,
physics: const AlwaysScrollableScrollPhysics(),
itemCount: walletChangeNotifier.walletInfo.history.length + 1,
itemBuilder: (BuildContext context, int index) {
// Spacer at the bottom of the list
if (index == walletChangeNotifier.walletInfo.history.length) {
return listBottomScrollSpace;
}

WalletHistoryItemData itemData = walletChangeNotifier.walletInfo.history[index];
WalletHistoryItemData itemData =
walletChangeNotifier.walletInfo.history[index];

return itemData.toWidget();
},
return itemData.toWidget();
},
),
),
),
],
Expand Down