Skip to content

Commit

Permalink
fix InkWell radius & v1.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
huextrat committed Mar 23, 2021
1 parent b655a8e commit 669fabf
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,8 @@
## 1.4.2 - 2021-03-23

- Fix InkWell when radius is applied to decoration
- `onMenuButtonToggle` is no more required

## 1.4.1 - 2021-03-09

- More precise API Docs
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -13,7 +13,7 @@ Flutter widget to display a popup menu button very simply and easily customizabl

## Installations

Add `menu_button: ^1.4.1` in your `pubspec.yaml` dependencies. And import it:
Add `menu_button: ^1.4.2` in your `pubspec.yaml` dependencies. And import it:

```dart
import 'package:menu_button/menu_button.dart';
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Expand Up @@ -80,7 +80,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.4.1"
version: "1.4.2"
meta:
dependency: transitive
description:
Expand Down
10 changes: 7 additions & 3 deletions lib/menu_button.dart
Expand Up @@ -134,6 +134,7 @@ class _MenuButtonState<T> extends State<MenuButton<T>> {
child: Material(
color: widget.menuButtonBackgroundColor,
child: InkWell(
borderRadius: decoration.borderRadius as BorderRadius,
child: Container(
child: widget.child,
),
Expand Down Expand Up @@ -259,7 +260,9 @@ class _MenuButtonState<T> extends State<MenuButton<T>> {
/// The method to toggle the popup when button is pressed
void togglePopup() {
setState(() => toggledMenu = !toggledMenu);
widget.onMenuButtonToggle!(toggledMenu);
if (widget.onMenuButtonToggle != null) {
widget.onMenuButtonToggle!(toggledMenu);
}
if (!widget.showSelectedItemOnList) {
setState(() => selectedItem = widget.selectedItem!);
MenuButtonUtils.showSelectedItemOnList(
Expand Down Expand Up @@ -303,8 +306,9 @@ class _MenuButtonState<T> extends State<MenuButton<T>> {
itemBackgroundColor: widget.itemBackgroundColor,
).then<void>((T? newValue) {
setState(() => toggledMenu = !toggledMenu);
widget.onMenuButtonToggle!(toggledMenu);

if (widget.onMenuButtonToggle != null) {
widget.onMenuButtonToggle!(toggledMenu);
}
if (!widget.showSelectedItemOnList && newValue != null) {
setState(() => oldItem = selectedItem);
setState(() => selectedItem = newValue);
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
@@ -1,7 +1,7 @@
name: menu_button
description: A menu button widget to select an item in a dropdown list easily customizable
homepage: https://github.com/huextrat/menu_button
version: 1.4.1
version: 1.4.2

environment:
sdk: ">=2.12.0 <3.0.0"
Expand Down

0 comments on commit 669fabf

Please sign in to comment.