Skip to content

Commit

Permalink
docs(flutter_weather): add top level weather barrel file (#4306)
Browse files Browse the repository at this point in the history
Co-authored-by: Felix Angelov <felangelov@gmail.com>
  • Loading branch information
EasonLin0716 and felangel authored Jan 12, 2025
1 parent cff02a3 commit 3f703cc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
import { Code } from '@astrojs/starlight/components';
const code = `
export 'models/models.dart';
`;
---

<Code code={code} lang="dart" title="lib/weather/weather.dart" />
5 changes: 5 additions & 0 deletions docs/src/content/docs/tutorials/flutter-weather.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import FlutterCreateRepositorySnippet from '~/components/tutorials/flutter-weath
import RepositoryModelsBarrelTreeSnippet from '~/components/tutorials/flutter-weather/RepositoryModelsBarrelTreeSnippet.astro';
import WeatherRepositoryLibrarySnippet from '~/components/tutorials/flutter-weather/WeatherRepositoryLibrarySnippet.astro';
import WeatherCubitTreeSnippet from '~/components/tutorials/flutter-weather/WeatherCubitTreeSnippet.astro';
import WeatherBarrelDartSnippet from '~/components/tutorials/flutter-weather/WeatherBarrelDartSnippet.astro';

![advanced](https://img.shields.io/badge/level-advanced-red.svg)

Expand Down Expand Up @@ -465,6 +466,10 @@ Let's export our models from the barrel file (`flutter_weather/lib/weather/model
title="lib/weather/models/models.dart"
/>

Then, let's create a top-level weather barrel file (`flutter_weather/lib/weather/weather.dart`);

<WeatherBarrelDartSnippet />

### Weather

We will use `HydratedCubit` to enable our app to remember its application state, even after it's been closed and reopened.
Expand Down

0 comments on commit 3f703cc

Please sign in to comment.