Skip to content

Commit

Permalink
Merge branch 'main' into alestiago/testing-section
Browse files Browse the repository at this point in the history
  • Loading branch information
marwfair authored Sep 5, 2024
2 parents 54df579 + 22f1ea1 commit 2c8c484
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions src/content/docs/widgets/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -86,20 +86,9 @@ void main() {
}
```

## Widgets vs Helper Methods
## Use standalone Widgets over helper methods

When you're creating a widget, sometimes you want to split the widget up into smaller pieces to make the widget reusable or improve readability.

```dart
class MyWidget extends StatelessWidget {
const MyWidget({super.key});
@override
Widget build(BuildContext context) {
return const Text('Hello World!');
}
}
```
If a Widget starts growing with complexity, you might want to split the build method up. Instead of creating a function, simply create a new Widget.

<Tabs>
<TabItem label="Good ✅">
Expand Down

0 comments on commit 2c8c484

Please sign in to comment.