From fa876fe4868b8d0f1333d53d7c0598476e64dd4b Mon Sep 17 00:00:00 2001 From: Nicholas Kolatsis Date: Thu, 6 Feb 2025 13:14:53 +0100 Subject: [PATCH 1/2] Added the barrel file updates needed to get the todos_api package working --- docs/src/content/docs/tutorials/flutter-todos.mdx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/src/content/docs/tutorials/flutter-todos.mdx b/docs/src/content/docs/tutorials/flutter-todos.mdx index fe4b7f99bdd..8898ffe5899 100644 --- a/docs/src/content/docs/tutorials/flutter-todos.mdx +++ b/docs/src/content/docs/tutorials/flutter-todos.mdx @@ -143,6 +143,20 @@ The `Todo` model uses [json_serializable](https://pub.dev/packages/json_serializ The model of the `Todo` is defined in `todos_api/models/todo.dart` and is exported by `package:todos_api/todos_api.dart`. +#### Update Exports + +Our ToDo model and the ToDosApi is made available externally (and internally) through barrel files. Notice how we don't import the ToDo model directly, but we import it in `lib/src/todos_api.dart` with a reference to the package barrel file: `import 'package:todos_api/todos_api.dart';`. Now, update the barrel files to resolve any remaining import errors. + + + + + #### Streams vs Futures In a previous version of this tutorial, the `TodosApi` was `Future`-based rather than `Stream`-based. From 7068104af2f120a9d45381146b14bb5b7ce73997 Mon Sep 17 00:00:00 2001 From: Felix Angelov Date: Mon, 17 Feb 2025 11:59:33 -0600 Subject: [PATCH 2/2] Update docs/src/content/docs/tutorials/flutter-todos.mdx --- docs/src/content/docs/tutorials/flutter-todos.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/content/docs/tutorials/flutter-todos.mdx b/docs/src/content/docs/tutorials/flutter-todos.mdx index 8898ffe5899..97d295ed6fa 100644 --- a/docs/src/content/docs/tutorials/flutter-todos.mdx +++ b/docs/src/content/docs/tutorials/flutter-todos.mdx @@ -145,7 +145,7 @@ The model of the `Todo` is defined in `todos_api/models/todo.dart` and is export #### Update Exports -Our ToDo model and the ToDosApi is made available externally (and internally) through barrel files. Notice how we don't import the ToDo model directly, but we import it in `lib/src/todos_api.dart` with a reference to the package barrel file: `import 'package:todos_api/todos_api.dart';`. Now, update the barrel files to resolve any remaining import errors. +Our `Todo` model and the `TodosApi` are exported via barrel files. Notice how we don't import the model directly, but we import it in `lib/src/todos_api.dart` with a reference to the package barrel file: `import 'package:todos_api/todos_api.dart';`. Update the barrel files to resolve any remaining import errors: