Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add being able to build the dial as open by default. #159

Closed
castdrian opened this issue May 27, 2021 · 21 comments
Closed

add being able to build the dial as open by default. #159

castdrian opened this issue May 27, 2021 · 21 comments
Labels
good first issue Good for newcomers v4

Comments

@castdrian
Copy link

I'm building a different dial with different options upon pressing a child button, and I'd like the ability to build the dial in an open state instead of a closed one.

@prateekmedia
Copy link
Collaborator

I'm building a different dial with different options upon pressing a child button, and I'd like the ability to build the dial in an open state instead of a closed one.

Hmm nice, you can use openCloseDial property and set its value to true using a ValueNotifier(true)

But still if you want any other way or above way doesn't work then I will implement it in the new branch.

@castdrian
Copy link
Author

castdrian commented May 27, 2021

@prateekmedia I tried setting it to true, but that did not work, on the dev branch

@prateekmedia
Copy link
Collaborator

I have supplied an additional property in v 4.0,0-dev.1 but it is still not completely usable so I have to do something with it or maybe if you can help me with it.

@prateekmedia prateekmedia added the good first issue Good for newcomers label May 29, 2021
@castdrian
Copy link
Author

I have supplied an additional property in v 4.0,0-dev.1 but it is still not completely usable so I have to do something with it or maybe if you can help me with it.

Sure, whatcha need

@prateekmedia
Copy link
Collaborator

Sure, whatcha need

The problem is that I cannot display the overlay in initState as it is resulting in a setState called when markNeedsBuild error.

Somehow if it could be fixed if you know anything related then you can submit a PR or else I will try to figure it out using Google or by hit and trial.

@castdrian
Copy link
Author

castdrian commented May 29, 2021 via email

@prateekmedia
Copy link
Collaborator

prateekmedia commented May 29, 2021

@adrifcastr Thanks fixed it, will push the code soon.

@prateekmedia
Copy link
Collaborator

Fixed by 1ba8555

You can test it using below code snippet in pubspec.yaml

 flutter_speed_dial: 
    git:
      url: git://github.com/darioielardi/flutter_speed_dial.git
      ref: master

@castdrian
Copy link
Author

hm, does not seem to be working
https://depressed-lemonade.me/aD94wyQ.mp4

@prateekmedia
Copy link
Collaborator

hm, does not seem to be working
https://depressed-lemonade.me/aD94wyQ.mp4

It worked for me, have you tried hot restart.

@prateekmedia prateekmedia reopened this May 30, 2021
@prateekmedia
Copy link
Collaborator

hm, does not seem to be working
https://depressed-lemonade.me/aD94wyQ.mp4

Please compile it with latest master branch if you don't have done it yet.

@castdrian
Copy link
Author

castdrian commented May 30, 2021

I did, ran flutter clean multiple times so that it refreshes the dependency

@castdrian
Copy link
Author

@prateekmedia okay so I think I found the culptrit:

it works when it's the first dial that gets built within the widget.

If I call setState and replace the dial after clicking on a child, it builds the new dial closed no matter what is specified.

@prateekmedia
Copy link
Collaborator

@prateekmedia okay so I think I found the culptrit:....

If you don't want to close dial then you can try setting closeManually property to true, If that's what you mean.

Otherwise when I add isOpenOnStart to true then it in the open state by default.

Is there anything other than this which is left in your issue?

@castdrian
Copy link
Author

castdrian commented May 30, 2021 via email

@prateekmedia
Copy link
Collaborator

O sorry bout that, I now understand what you mean, let me see what I can do.

@prateekmedia
Copy link
Collaborator

You should use openCloseDIal property then if you want to open the dial after pressing the child, although its not a bug or a issue.

When you reset your children's or you replace existing speedDial then you can follow the steps on readme for onWillPop to know how to open it directly after that.

@castdrian
Copy link
Author

I'll try to see if that works tomorrow, I just assumed that it would work if I build a new dial from the dial itself

@castdrian
Copy link
Author

Tried playing with the willpop stuff, but I cannot get the 2nd dial to open on when rebuilding

@prateekmedia
Copy link
Collaborator

Tried playing with the willpop stuff, but I cannot get the 2nd dial to open on when rebuilding

Can you give me some sample code to play with, as this is not the library issue but a question instead.

@castdrian
Copy link
Author

castdrian commented Jun 1, 2021

Can you give me some sample code to play with, as this is not the library issue but a question instead.

Yeah this is my widget here https://github.com/adrifcastr/ImageLink/blob/b1fdaac395ccce586c2e3f2898eb9b8327a4268f/lib/home.dart#L180
(this is from a few days ago so it doesn't contain the new property yet, but that shouldn't matter, I have it locally)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers v4
Projects
None yet
Development

No branches or pull requests

2 participants