Skip to content
This repository has been archived by the owner on Jan 19, 2023. It is now read-only.

some probs #1

Closed
mikes222 opened this issue Jun 18, 2019 · 4 comments
Closed

some probs #1

mikes222 opened this issue Jun 18, 2019 · 4 comments

Comments

@mikes222
Copy link

mikes222 commented Jun 18, 2019

  1. why do you force the child parameter? seems it is not really necessary.
  2. I suggest to assert required params, e.g. FabCircularMenu(...) : assert(child != null), assert(options != null && options.length > 0);
  3. If you want to provide this code as a library you need to move it to the lib/src folder and provide a dart file with export statements. See other libs. Currently I am unable to use your code as a lib. I rather copied the source code into my own repository instead.
  4. Please add a dispose method:
    @override
    void dispose() {
      controller?.dispose();
      super.dispose();
    }
  1. I still struggle when using 4 icons. In closed state the middle icons 1 and 2 are shown in the right-bottom corner beneath the fab.

grafik

grafik

You may find the problem, I don't currently.

  1. Seems it is not allowed to init the controller twice. Move that initialization to the initState() method instead:
  @override
  void initState() {
    super.initState();
    controller = AnimationController(duration: widget.animationDuration, vsync: this);
  }
@marianocordoba
Copy link
Owner

Thank you a lot for your feedback. This is my first package so i'm still learning.
I will take a look asap.

@spiralni
Copy link

Beautiful widget. You must NOT initialize controller in the didChangeDependenciesMethod() but instead initialize it in the initState(). Right now I am having a problem when I open a new screen using navigator e.g

void _navigateToTreatment(BuildContext context) { Navigator.of(context).push( MaterialPageRoute( builder: (context) => TreatmentFormPage(), ) ); }

I've got this error message:

_FabCircularMenuState is a SingleTickerProviderStateMixin but multiple tickers were created.

and its because of the re-assigment of the controller in the didChangeDependenciesMethod().

Plus, it will be interesting exposing the method to reverse the animation manually.

Thanks, and good work!

@kevinomyonga
Copy link

Beautiful widget. You must NOT initialize controller in the didChangeDependenciesMethod() but instead initialize it in the initState(). Right now I am having a problem when I open a new screen using navigator e.g

void _navigateToTreatment(BuildContext context) { Navigator.of(context).push( MaterialPageRoute( builder: (context) => TreatmentFormPage(), ) ); }

I've got this error message:

_FabCircularMenuState is a SingleTickerProviderStateMixin but multiple tickers were created.

and its because of the re-assigment of the controller in the didChangeDependenciesMethod().

Plus, it will be interesting exposing the method to reverse the animation manually.

Thanks, and good work!

Has a solution to the aforementioned issue been found?

marianocordoba added a commit that referenced this issue Dec 1, 2019
@marianocordoba
Copy link
Owner

Ok, i fixed the issue found by @spiralni, added an assertion and a dispose method. The child is still required because you are supposed to use this widget as a container, not as a Scaffold's floatingActionButton because if you do that, you end up with a margin around the circle.

marianocordoba added a commit that referenced this issue Dec 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants