Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
￴￴ committed Nov 26, 2024
1 parent c4632e5 commit 41e1c97
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## 0.0.28
## 0.0.29

- Initial Release
24 changes: 23 additions & 1 deletion lib/core/scroll_controller_auto_keep_state_data.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// ignore_for_file: empty_catches

/* <!-- START LICENSE -->
Expand Down Expand Up @@ -90,7 +92,7 @@ class ScrollControllerAutoKeepStateData extends ChangeNotifier {
@override
void dispose() {
scroll_controller.dispose();

valueNotifierIsScrolling.dispose();

super.dispose();
Expand All @@ -117,6 +119,26 @@ class ScrollControllerAutoKeepStateData extends ChangeNotifier {
});
}

bool isAtEdge() {
try {
return scroll_controller.position.atEdge;
} catch (e) {}
return false;
}

Alignment alignment() {
if (isAtEdge()) {
try {
if (scroll_controller.position.pixels == scroll_controller.position.minScrollExtent) {
return Alignment.topCenter;
} else if (scroll_controller.position.pixels == scroll_controller.position.maxScrollExtent) {
return Alignment.bottomCenter;
}
} catch (e) {}
}
return Alignment.center;
}

/// wrap page for auto set
Widget build({
required Widget child,
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 'general_lib_flutter'
description: 'Library for make flutter more easy and more short with universal extension, utils, and more.'
version: '0.0.27'
version: '0.0.29'
environment:
sdk: '>=3.3.3 <4.0.0'
flutter: '>=3.10.0'
Expand All @@ -12,7 +12,7 @@ dev_dependencies:
flutter_test:
sdk: 'flutter'
flutter_lints: '^4.0.0'
general_lib: '^0.0.47'
general_lib: '^0.0.48'
dependency_overrides:
pointycastle: '3.8.0'
funding:
Expand Down

0 comments on commit 41e1c97

Please sign in to comment.