brianegan / brianegan/flutter_architecture_samples

Comments on the Vanilla example

Open
#72 3 comments 0 reactions 0 assignees View on GitHub
enhancement good first issue
Dominant language
Dart
Stars
8.9k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

A couple of comments.

1. The vanilla sample is too complex for a flutter/dart beginner. The discussion located at flutter_architecture_samples/example/vanilla/ is useful in explaining how flutter can implement inter-widget communications out of the box. However, IMHO it is extraordinarily complex. It has pieces scattered all over the directory structure. Is there a simpler example? Somewhere you wrote that for multiple state values, I might try a Map. Vanilla was the closest example I could find. The example at https://medium.com/@maksimrv/reactive-app-state-in-flutter-73f829bcf6a7 is fine for a single state value but offers no help with multiple values.

2. The following code (from flutter_architecture_samples-master\example\vanilla\lib\models.dart) presumably (from its name) toggles the value of the **complete** member of each TodoEntry

```
void toggleAll() {
final allCompleted = this.allComplete;

todos.forEach((todo) => todo.complete = !allCompleted);
}
```

Why is **allCompleted** invoked? Why doesn't the code read

` todos.forEach((todo) => todo.complete = !todo.complete);`

If that was not what was intended, then the method's name should changed or a /// comment added preceding the declaration.

Kudos: Thank you for your teaching efforts. It is fantastic work!

Contributor guide

Open the contributing guide

Research direction

Start in example/vanilla/, especially example/vanilla/lib/models.dart, and inspect toggleAll alongside allComplete to understand the intended behavior. Review the example’s scattered structure and the request for a simpler multi-value state example. Done means the toggleAll behavior is clearly explained or documented and the beginner guidance addresses the requested complexity.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.