Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
- [ModularState](#modularstate)
- [Consuming a ChangeNotifier Class](#consuming-a-changenotifier-class)
- [Creating Child Modules](#creating-child-modules)
- [ModuleWidget](#modulewidget)
- [WidgetModule](#widgetmodule)
- [RouterOutlet](#routeroutlet)
- [Lazy Loading](#lazy-loading)
- [Unit Test](#unit-test)
Expand Down Expand Up @@ -503,12 +503,12 @@ class AppModule extends MainModule {

Consider splitting your code into modules such as `LoginModule`, and into it placing routes related to that module. Maintaining and sharing code in another project will be much easier.

### ModuleWidget
### WidgetModule

The same structure as `ChildModule`. Very useful for modular TabBar visualizations.

```dart
class TabModule extends ModuleWidget {
class TabModule extends WidgetModule {

@override
List<Bind> get binds => [
Expand Down
6 changes: 3 additions & 3 deletions README.pt-br.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
- [ModularState](#modularstate)
- [Consumindo uma Classe ChangeNotifier](#consumindo-uma-classe-changenotifier)
- [Criando Módulos Filhos](#criando-módulos-filhos)
- [ModuleWidget](#modulewidget)
- [WidgetModule](#widgetmodule)
- [RouterOutlet](#routeroutlet)
- [Lazy Loading](#lazy-loading)
- [Testes Unitários](#testes-unitários)
Expand Down Expand Up @@ -503,12 +503,12 @@ class AppModule extends MainModule {

Pense em dividir seu código em módulos como por exemplo, `LoginModule`, e dentro dele colocar as rotas relacionadas a esse módulo. Ficará muito mais fácil a manutenção e o compartilhamento do código em outro projeto.

### ModuleWidget
### WidgetModule

A mesma estrutura de um MainModule/ChildModule. Muito útil para usar em uma TabBar com páginas modulares

```dart
class TabModule extends ModuleWidget {
class TabModule extends WidgetModule {

@override
List<Bind> get binds => [
Expand Down
4 changes: 2 additions & 2 deletions lib/src/widgets/module_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ _debugPrintModular(String text) {
}
}

abstract class ModuleWidget extends StatelessWidget implements ChildModule {
abstract class WidgetModule extends StatelessWidget implements ChildModule {
@override
List<Bind> get binds;

Widget get view;

final _FakeModule _fakeModule = _FakeModule();

ModuleWidget() {
WidgetModule() {
_fakeModule.changeBinds(binds);
}

Expand Down
2 changes: 1 addition & 1 deletion test/modular_widget_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ main() {
});
}

class OtherWidget extends ModuleWidget {
class OtherWidget extends WidgetModule {
@override
List<Bind> get binds => [
Bind((i) => ObjectTest()),
Expand Down