Comments (4)
Hi, how do you use InfiniteScrollController?
from flutter.
@julien-kv Can you share a complete and minimal sample code? Does that mean you can reproduce this issue in release
model on local machine? (run with --release
) Or does the issue only happen in production release?
from flutter.
import 'package:flutter/cupertino.dart';
import 'package:get/get.dart';
class InfiniteScrollController extends GetxController {
final Function() onLoading;
final Future<void> Function() onRefresh;
final RxBool isLastPage = false.obs;
final RxBool error = false.obs;
final RxBool loading = false.obs;
final RxBool refreshLoading = false.obs;
final RxBool refreshError = false.obs;
final ScrollController scrollController = ScrollController();
InfiniteScrollController({required this.onLoading, required this.onRefresh});
@override
void onInit() {
scrollController.addListener(_trigger);
super.onInit();
}
void _trigger() {
final nextPageTrigger = 0.8 * scrollController.position.maxScrollExtent;
if (scrollController.position.pixels > nextPageTrigger && isLastPage.isFalse && loading.isFalse) {
loading.value = true;
onLoading();
}
}
void loadComplete() {
loading.value = false;
}
void loadNoData() {
isLastPage.value = true;
}
void loadFailed() {
error.value = true;
}
void resetNoData() {
isLastPage.value = false;
error.value = false;
refreshError.value = false;
loading.value = false;
}
void refreshCompleted() {
refreshLoading.value = false;
}
void refreshFailed() {
refreshError.value = true;
}
}
This is my InfiniteScrollController and in every controllers i use, i create seperate instance of infinite controller
tempRefreshController = Get.put(
InfiniteScrollController(
onRefresh: () async {
fetchItems()
},
onLoading: () {
fetchItems();
},
),
tag: tag(),
);
I can reproduce this issue in release model on local machine.
from flutter.
Your sample code still uses get
package and is incomplete. Please provide a completed and minimal reproducible code sample that doesnโt include 3rd party plugins/packages and in a main.dart
file so that we can use it to reproduce the issue. Thanks!
from flutter.
Related Issues (20)
- InkWell onLongPress not respecting HapticFeedback conditional HOT 2
- Regression in `bench_update_many_child_layers.canvaskit.drawFrameDuration.outlierRatio` HOT 7
- [web] tappable plain text semanic nodes receive double mouse clicks
- [CP] Fix crash in `DateTime.timezoneOffset` HOT 1
- Not an issue but a thank you HOT 1
- Cannot decode JPEG on flutter web HOT 1
- [Impeller] rendering bug on certain iPad models. HOT 1
- `google_sign_in` needs fallback to OAuth2 if Google Play Services is not available HOT 1
- win-1 is low disk space on C: drive. HOT 1
- mac-20 is dead. HOT 1
- mac-3 is dead. HOT 1
- mac-10 is dead. HOT 1
- mac-13 is dead. HOT 1
- win-19 is dead. HOT 1
- Text Brightness updates after delay after popping route [Video Included] HOT 1
- CompositedTransformTarget HOT 1
- [web] Button becomes un-tappable in Flutter Web when a TextField is present. HOT 1
- Flutter reports an error when running normally(Android)
- Not able to import Flutter in existing iOS project
- Improper Rendering of Items with Large Data When Vertical Scrolling.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter.