Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

Update README.md #1047

Merged
merged 4 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions DEVELOPING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
## Development

<details>
<summary>Generating localizations</summary>

If this is the first time building the Flutter Gallery, the localized
code will not be present in the project directory. However, after running
the application for the first time, a synthetic package will be generated
containing the app's localizations through importing
`package:flutter_gen/gen_l10n/`.

```bash
flutter pub get
flutter pub run grinder l10n
```

See separate [README](lib/l10n/README.md) for more details.

</details>

<details>
<summary>Generating highlighted code segments</summary>

```bash
flutter pub get
flutter pub run grinder update-code-segments
```

See separate [README](tool/codeviewer_cli/README.md) for
more details.

</details>

<details>
<summary>Including a new splash animation</summary>

1. Convert your animation to a `.gif` file.
Ideally, use a background color of `0xFF030303` to ensure the animation
blends into the background of the app.

2. Add your new `.gif` file to the assets directory under
`assets/splash_effects`. Ensure the name follows the format
`splash_effect_$num.gif`. The number should be the next number after the
current largest number in the repository.

3. Update the map `_effectDurations` in
[splash.dart](lib/pages/splash.dart) to include the number of the
new `.gif` as well as its estimated duration. The duration is used to
determine how long to display the splash animation at launch.
</details>

## Releasing

*must be a `flutter-hackers` member*

A set of GitHub workflows are available to help with releasing the Flutter Gallery, one per releasing platform.

1. For Android, download the relevant [Firebase configuration file](https://firebase.corp.google.com/u/0/project/gallery-flutter-dev/settings/general) (e.g. `google-services.json`).
1. Bump the `pubspec.yaml` version number. This can be in a PR making a change or a separate PR.
Use [semantic versioning](https://semver.org/) to determine
which part to increment. **The version number after the `+` should also be incremented**. For example `1.2.3+010203`
with a patch should become `1.2.4+010204`.

1. Run GitHub workflow.
- [Deploy to web](https://github.com/flutter/gallery/actions/workflows/release_deploy_web.yml): Deploys a web build to the Firebase-hosted [staging](https://gallery-flutter-staging.web.app) or [production](https://gallery.flutter.dev) site.
- [Deploy to Play Store](https://github.com/flutter/gallery/actions/workflows/release_deploy_play_store.yml): Uses Fastlane to create a [beta](https://play.google.com/console/u/0/developers/7661132837216938445/app/4974617875198505129/tracks/open-testing) (freely available on the [Play Store](https://play.google.com/apps/testing/io.flutter.demo.gallery)) or promote an existing beta to [production](https://play.google.com/console/u/0/developers/7661132837216938445/app/4974617875198505129/tracks/production) ([Play Store](https://play.google.com/store/apps/details?id=io.flutter.demo.gallery)).
> **Note**
> Once an .aab is created with a particular version number, it can't be replaced. The pubspec version number must be incremented again.

- [Draft GitHub release](https://github.com/flutter/gallery/actions/workflows/release_draft_github_release.yml): Drafts a GitHub release, including packaged builds for Android, macOS, Linux, and Windows. Release notes can be automatically generated. The release draft is private until published. Upon being published, the specified version tag will be created.
- [Publish on Windows Store](): Releasing to the Windows Store.
> **Note**
> This repository is not currently set up to publish new versions of [the current Windows Store listing](https://www.microsoft.com/store/productId/9PDWCTDFC7QQ). Requires running `msstore init` within the repository and setting repository/environment secrets .
> See the instructions in the [documentation](https://docs.flutter.dev/deployment/windows#github-actions-cicd) for more information.

<details>
<summary>Escape hatch</summary>

If the above GitHub workflows aren't functional (#759), releasing can be done semi-manually. Since this requires obtaining environment secrets, this can only be done by a Googler. See go/flutter-gallery-manual-deployment.


</details>

## Tests

The gallery has its own set of unit, golden, and integration tests.

In addition, Flutter itself uses the gallery in tests. To enable breaking changes, the gallery version is pinned in two places:

- `flutter analyze`: https://github.com/flutter/tests/blob/master/registry/flutter_gallery.test
- DeviceLab tests: https://github.com/flutter/flutter/blob/master/dev/devicelab/lib/versions/gallery.dart

[latest release]: https://github.com/flutter/gallery/releases/latest
191 changes: 28 additions & 163 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,165 +1,30 @@
# Flutter Gallery

Flutter Gallery is a resource to help developers evaluate and use Flutter.
It is a collection of Material Design & Cupertino widgets, behaviors, and vignettes
implemented with Flutter. We often get asked how one can see Flutter in action,
and this gallery demonstrates what Flutter provides and how it behaves in the
wild.

![Flutter Gallery](https://user-images.githubusercontent.com/6655696/73928238-0d7fcc80-48d3-11ea-8a7e-ea7dc5d6e713.png)

## Features

- Showcase for `material`, `cupertino`, and other widgets
- [Adaptive layout](lib/layout/adaptive.dart) for mobile and desktop
- State restoration support
- Settings to text scaling, text direction, locale, theme, and more...
- Demo for `animations`
- Foldable support and demo for `dual_screen`
- Deferred loading
- CI/CD
- ...and much more!

## Supported Platforms

Flutter Gallery has been built to support multiple platforms.
These include:

- Android ([Google Play Store](https://play.google.com/store/apps/details?id=io.flutter.demo.gallery), [.apk][latest release])
- iOS (locally)
- web ([gallery.flutter.dev](https://gallery.flutter.dev/))
- macOS ([.zip][latest release])
- Linux ([.tar.gz][latest release])
- Windows ([.zip][latest release], [.msix](https://www.microsoft.com/store/productId/9PDWCTDFC7QQ))

## Running

One can run the gallery locally for any of these platforms. For desktop platforms,
please see the [Flutter docs](https://docs.flutter.dev/desktop) for the latest
requirements.

```bash
cd gallery/
flutter pub get
flutter run
```

<details>
<summary>Troubleshooting</summary>

### Flutter `master` channel

The Flutter Gallery targets Flutter's `master` channel. As such, it can take advantage
of new SDK features that haven't landed in the stable channel.

If you'd like to run the Flutter Gallery, you may have to switch to the `master` channel
first:

```bash
flutter channel master
flutter upgrade
```

When you're done, use this command to return to the safety of the `stable`
channel:

```bash
flutter channel stable
flutter upgrade
```

</details>

## Development

<details>
<summary>Generating localizations</summary>

If this is the first time building the Flutter Gallery, the localized
code will not be present in the project directory. However, after running
the application for the first time, a synthetic package will be generated
containing the app's localizations through importing
`package:flutter_gen/gen_l10n/`.

```bash
flutter pub get
flutter pub run grinder l10n
```

See separate [README](lib/l10n/README.md) for more details.

</details>

<details>
<summary>Generating highlighted code segments</summary>

```bash
flutter pub get
flutter pub run grinder update-code-segments
```

See separate [README](tool/codeviewer_cli/README.md) for
more details.

</details>

<details>
<summary>Including a new splash animation</summary>

1. Convert your animation to a `.gif` file.
Ideally, use a background color of `0xFF030303` to ensure the animation
blends into the background of the app.

2. Add your new `.gif` file to the assets directory under
`assets/splash_effects`. Ensure the name follows the format
`splash_effect_$num.gif`. The number should be the next number after the
current largest number in the repository.

3. Update the map `_effectDurations` in
[splash.dart](lib/pages/splash.dart) to include the number of the
new `.gif` as well as its estimated duration. The duration is used to
determine how long to display the splash animation at launch.
</details>

## Releasing

*must be a `flutter-hackers` member*

A set of GitHub workflows are available to help with releasing the Flutter Gallery, one per releasing platform.

1. For Android, download the relevant [Firebase configuration file](https://firebase.corp.google.com/u/0/project/gallery-flutter-dev/settings/general) (e.g. `google-services.json`).
1. Bump the `pubspec.yaml` version number. This can be in a PR making a change or a separate PR.
Use [semantic versioning](https://semver.org/) to determine
which part to increment. **The version number after the `+` should also be incremented**. For example `1.2.3+010203`
with a patch should become `1.2.4+010204`.

1. Run GitHub workflow.
- [Deploy to web](https://github.com/flutter/gallery/actions/workflows/release_deploy_web.yml): Deploys a web build to the Firebase-hosted [staging](https://gallery-flutter-staging.web.app) or [production](https://gallery.flutter.dev) site.
- [Deploy to Play Store](https://github.com/flutter/gallery/actions/workflows/release_deploy_play_store.yml): Uses Fastlane to create a [beta](https://play.google.com/console/u/0/developers/7661132837216938445/app/4974617875198505129/tracks/open-testing) (freely available on the [Play Store](https://play.google.com/apps/testing/io.flutter.demo.gallery)) or promote an existing beta to [production](https://play.google.com/console/u/0/developers/7661132837216938445/app/4974617875198505129/tracks/production) ([Play Store](https://play.google.com/store/apps/details?id=io.flutter.demo.gallery)).
> **Note**
> Once an .aab is created with a particular version number, it can't be replaced. The pubspec version number must be incremented again.

- [Draft GitHub release](https://github.com/flutter/gallery/actions/workflows/release_draft_github_release.yml): Drafts a GitHub release, including packaged builds for Android, macOS, Linux, and Windows. Release notes can be automatically generated. The release draft is private until published. Upon being published, the specified version tag will be created.
- [Publish on Windows Store](): Releasing to the Windows Store.
> **Note**
> This repository is not currently set up to publish new versions of [the current Windows Store listing](https://www.microsoft.com/store/productId/9PDWCTDFC7QQ). Requires running `msstore init` within the repository and setting repository/environment secrets .
> See the instructions in the [documentation](https://docs.flutter.dev/deployment/windows#github-actions-cicd) for more information.

<details>
<summary>Escape hatch</summary>

If the above GitHub workflows aren't functional (#759), releasing can be done semi-manually. Since this requires obtaining environment secrets, this can only be done by a Googler. See go/flutter-gallery-manual-deployment.


</details>

## Tests

The gallery has its own set of unit, golden, and integration tests.

In addition, Flutter itself uses the gallery in tests. To enable breaking changes, the gallery version is pinned in two places:

- `flutter analyze`: https://github.com/flutter/tests/blob/master/registry/flutter_gallery.test
- DeviceLab tests: https://github.com/flutter/flutter/blob/master/dev/devicelab/lib/versions/gallery.dart

[latest release]: https://github.com/flutter/gallery/releases/latest
**NOTE**: The Flutter Gallery is now deprecated, and no longer being active maintained.

Flutter Gallery was a resource to help developers evaluate and use Flutter.
It is now being used primarily for testing.

We recommend Flutter developers check out the following resources:

* **Wonderous**:
(
[web demo](https://wonderous.app/web/#/home),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We sure we're ready to share this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll let you make the call on that; what do you think should be fixed first?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're SUPER close. Hopefully next week!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kevmoo how are we tracking?

[App Store](https://apps.apple.com/us/app/wonderous/id1612491897),
[Google Play](https://play.google.com/store/apps/details?id=com.gskinner.flutter.wonders),
[source code](https://github.com/gskinnerTeam/flutter-wonderous-app)
):<br>
A Flutter app that showcases Flutter's support for elegant design and rich animations.

* **Material 3 Gallery**
(
[web demo](https://flutter.github.io/samples/web/material_3_demo/),
[source code](https://github.com/flutter/samples/tree/main/material_3_demo)
):<br>
A Flutter app that showcases Material 3 features in the Flutter Material library.

* **Flutter Samples**:
(
[source code](https://github.com/flutter/samples)
):<br>
A collection of open source samples that illustrate best practices for Flutter.