Skip to content

Commit c93ab8a

Browse files
authored
Update README.md
1 parent 153e4a8 commit c93ab8a

File tree

1 file changed

+32
-30
lines changed

1 file changed

+32
-30
lines changed

README.md

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@
88
![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)
99
<br>
1010

11-
![Screen Shot 2022-02-03 at 00 32 35](https://user-images.githubusercontent.com/3827308/152278448-3c63a692-f390-4377-964b-6f2c447c0a70.png)
11+
![image](https://github.com/user-attachments/assets/60b3f22a-ffd2-4ea8-bcb4-5111366142b3)
12+
13+
---
14+
15+
### 💾 The Flutter Micro App package provides a Flutter DevTools Extension, so you can inspect the app event handlers, inspect the routes in Widget Tree through the Flutter Widget Inspector, dispatch events to control the app from outside, search for routes and export all routes to an Excel file (.xlsx)
16+
17+
<img width="1674" alt="image" src="https://github.com/user-attachments/assets/7f9dcca9-1085-401c-9096-fc03e7ed5563">
1218

1319
---
1420

@@ -43,35 +49,6 @@
4349
);
4450
```
4551

46-
### 💾 Flutter DevTools: Inspect the app, search for routes and export all routes to an Excel file (.xlsx)
47-
- Use Flutter Devtools in order to inspect the whole application structure and export all routes to an excel file.
48-
49-
<img width="1674" alt="image" src="https://github.com/user-attachments/assets/7f9dcca9-1085-401c-9096-fc03e7ed5563">
50-
51-
52-
```dart
53-
54-
// In order to use GoRouter, you need to add package https://pub.dev/packages/fma_go_router
55-
FmaGoRoute(
56-
description: 'This is a example of GoRouter page',
57-
path: 'page_with_id/:id',
58-
parameters: ExamplePageA.new, // If using `.new`, the parameters will be passed automatically, but you can use a String if you want to pass manually
59-
builder: (context, state) {
60-
return ExamplePageA(state.pathParameters['id']);
61-
},
62-
),
63-
64-
or
65-
66-
MicroAppPage(
67-
route: '/page2',
68-
parameters: Page2.new,
69-
pageBuilder: PageBuilder(
70-
widgetBuilder: (_, settings) =>
71-
Page2(title: settings.arguments as String?)),
72-
),
73-
```
74-
7552
---
7653

7754
### 🚀 Initialize the micro host, registering all micro apps
@@ -123,6 +100,31 @@ class MyApp extends MicroHostStatelessWidget { // Use MicroHostStatelessWidget o
123100
}
124101
```
125102

103+
The example above shows how to use a classic routing strategy, but you can use GoRouter to leverage an advanced routing system.
104+
105+
```dart
106+
// Register routes using classic routing or GoRouter
107+
// In order to use GoRouter, you need to add package https://pub.dev/packages/fma_go_router
108+
// IMPORTANT: See example code, in order to understand how GoRouter integration works
109+
FmaGoRoute(
110+
description: 'This is a example of GoRouter page',
111+
path: 'page_with_id/:id',
112+
parameters: ExamplePageA.new, // If using `.new`, the parameters will be passed automatically, but you can use a String if you want to pass manually
113+
builder: (context, state) {
114+
return ExamplePageA(state.pathParameters['id']);
115+
},
116+
),
117+
118+
// or use classic routing
119+
MicroAppPage(
120+
route: '/page2',
121+
parameters: Page2.new,
122+
pageBuilder: PageBuilder(
123+
widgetBuilder: (_, settings) =>
124+
Page2(title: settings.arguments as String?)),
125+
),
126+
```
127+
126128
### You can structure your application in many ways, this is one of the ways I usually use it in my projects.
127129

128130
![supperapp](https://user-images.githubusercontent.com/3827308/184520011-f1ca6d87-0451-46a2-94b8-53ed8cb2b58a.png)

0 commit comments

Comments
 (0)