Skip to content

Headlines and code unclear #13250

@surfmuggle

Description

@surfmuggle

Page URL

https://docs.flutter.dev/learn/pathway/tutorial/listenable-builder

Page source

https://github.com/flutter/website/blob/main/src/content/learn/pathway/tutorial/listenable-builder.md

Describe the problem

In the chapters

  • Create the article view widget and
  • Create the article view model

the code for class ArticleView is repeated twice and is identical but one line final viewModel = ArticleViewModel(ArticleModel());

should one code sample be ArticleWidget and the other ArticleView?

If not then having only one chapter might be better.

class ArticleView extends StatelessWidget {
  ArticleView({super.key});

  final viewModel = ArticleViewModel(ArticleModel()); // NEW in chapter view model

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Wikipedia Flutter'),
      ),
      body: const Center(
        child: Text('UI will update here'),
      ),
    );
  }
}

Expected fix

Remove one chapter or add explanatory text.

Additional context

No response

I would like to fix this problem.

  • I will try and fix this problem on docs.flutter.dev.

Metadata

Metadata

Assignees

No one assigned

    Labels

    from.page-issueReported in a reader-filed concern

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions