Pass parameter to a module using Widgetmodule (Modular)

Asked

Viewed 139 times

1

Good afternoon!

I have a Pageview with Bottomnavigation and would like to use modular in the Pages

I created the modules as Widgetmolude instead of Childmodule and everything is ok!!!

...
         body: SizedBox.expand(
          child: PageView(
            physics: new NeverScrollableScrollPhysics(),
            controller: _pageController,
            onPageChanged: (index) {
              setState(() => currentIndex = index);
            },
            children: <WidgetModule>[
              // Info(widget.store),
              // CustomMap(widget.store.lat, widget.store.long),
              InfoModule(), // Preciso passar parâmetros aqui
              MapModule(), // Preciso passar parâmetros aqui
              InvoicesModule()
            ],
          ),
        ),
... 

But how do I pass parameters?

EDIT:

The video nominated by Matheus Ribeiro: https://pub.dev/packages/flutter_modular#Adding-Routes cleared my doubts. Thank you very much

  • When working with Modular the way to call the screens changes a little... A package documentation (If this is the one you are using, as it did not specify right which is) behind enough information, I think it valid you take a look. I also believe that this video Modular Flutter - Creating Bottomnavigationbar (Routeroutlet) will cure your doubts.

  • A tip: Give as much information as possible in your questions here (which are useful). For example this question here, you have not shown us how your Modules are and we do not know what parameters exist on your screens... Makes it hard to help you

  • 1

    Thank you @Matheusribeiro, this video cleared my mind .. I was able to do what I wanted to do..

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.