Skip to content

Commit

Permalink
Merge pull request #62 from akshathjain/dev
Browse files Browse the repository at this point in the history
Fixed issue where panel listeners would be prematurely called
  • Loading branch information
akshathjain authored Sep 25, 2019
2 parents eb7d049 + 2776a85 commit c3476a7
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ playground/
**/ios/Flutter/app.flx
**/ios/Flutter/app.zip
**/ios/Flutter/flutter_assets/
**/ios/Flutter/flutter_export_environment.sh
**/ios/ServiceDefinitions.json
**/ios/Runner/GeneratedPluginRegistrant.*

Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## [0.3.6] - [September 25, 2019]

#### Fixes
- Fixed issues #54, #59 where panel listeners would be called before UI was rendered (related to `defaultPanelState`)

#### Documentation
- Updated the documentation to reflect fixes



## [0.3.5] - [August 31, 2019]

#### Features
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ A draggable Flutter widget that makes implementing a SlidingUpPanel much easier!
Add the following to your `pubspec.yaml` file:
```yaml
dependencies:
sliding_up_panel: ^0.3.5
sliding_up_panel: ^0.3.6
```
<br>
Expand Down
5 changes: 1 addition & 4 deletions lib/src/panel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ class _SlidingUpPanelState extends State<SlidingUpPanel> with SingleTickerProvid
_ac = new AnimationController(
vsync: this,
duration: const Duration(milliseconds: 300),
value: widget.defaultPanelState == PanelState.CLOSED ? 0.0 : 1.0 //set the default panel state (i.e. set initial value of _ac)
)..addListener((){
setState((){});

Expand All @@ -207,10 +208,6 @@ class _SlidingUpPanelState extends State<SlidingUpPanel> with SingleTickerProvid
_isPanelClosed,
_isPanelShown,
);

//set the default panel state
if(widget.defaultPanelState == PanelState.CLOSED) _ac.value = 0.0;
else if (widget.defaultPanelState == PanelState.OPEN) _ac.value = 1.0;
}

@override
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: sliding_up_panel
description: A draggable Flutter widget that makes implementing a SlidingUpPanel much easier!
version: 0.3.5
version: 0.3.6
author: Akshath Jain <[email protected]>
homepage: https://github.com/akshathjain/sliding_up_panel

Expand Down

0 comments on commit c3476a7

Please sign in to comment.