Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

Commit

Permalink
optimized the value listeners
Browse files Browse the repository at this point in the history
  • Loading branch information
soemre committed Jun 26, 2023
1 parent 10de853 commit 5c216cc
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
8 changes: 2 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# 4.1.0 Release
# 4.1.1 Release

- Fixed the `blockMenuClosing` feature issue

- Optimized the whole menu code

- Organized the whole menu code
- Optimized the Value Listeners

## 4.0.0 Release Notes

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

<p align="center">
<a href="https://pub.dev/packages/draggable_menu">
<img src="https://img.shields.io/badge/pub-v4.1.0-%237f7eff?style=flat&logo=flutter">
<img src="https://img.shields.io/badge/pub-v4.1.1-%237f7eff?style=flat&logo=flutter">
</a>
<a href="https://github.com/emresoysuren/draggable_menu">
<img src="https://img.shields.io/badge/GitHub-v4.1.0-%237f7eff?style=flat&logo=github">
<img src="https://img.shields.io/badge/GitHub-v4.1.1-%237f7eff?style=flat&logo=github">
</a>
</p>

Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ packages:
path: ".."
relative: true
source: path
version: "4.1.0"
version: "4.1.1"
fake_async:
dependency: transitive
description:
Expand Down
8 changes: 6 additions & 2 deletions lib/src/draggable_menu/menu/menu.dart
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ class _DraggableMenuState extends State<DraggableMenu>

// STATUS VALUES
DraggableMenuStatus _status = DraggableMenuStatus.minimized;
double? _valueLog;

// VARIBLES | END

Expand Down Expand Up @@ -380,8 +381,11 @@ class _DraggableMenuState extends State<DraggableMenu>
}

// NOTIFIES THE VALUE LISTENERS
_notifyValueListener() =>
widget.addValueListener?.call(_menuValue, _value, _levelValue);
_notifyValueListener() {
if (_valueLog == _value) return;
_valueLog = _value;
return widget.addValueListener?.call(_menuValue, _value, _levelValue);
}

// ANIMATETO METHOD

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: draggable_menu
description: Create Draggable Menus like some popular apps like Instagram, Snapchat, Facebook, Twitter, Youtube etc. You can even make your Draggable Menus look identical to them.
version: 4.1.0
version: 4.1.1
repository: https://github.com/emresoysuren/draggable_menu

environment:
Expand Down

0 comments on commit 5c216cc

Please sign in to comment.