|
|
@ -1,37 +1,31 @@
|
|
|
|
# Pinball
|
|
|
|
# I/O Pinball
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[![Pinball Header][logo]][pinball_link]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[![io_pinball][build_status_badge]][workflow_link]
|
|
|
|
![coverage][coverage_badge]
|
|
|
|
![coverage][coverage_badge]
|
|
|
|
[![style: very good analysis][very_good_analysis_badge]][very_good_analysis_link]
|
|
|
|
[![style: very good analysis][very_good_analysis_badge]][very_good_analysis_link]
|
|
|
|
[![License: MIT][license_badge]][license_link]
|
|
|
|
[![License: MIT][license_badge]][license_link]
|
|
|
|
|
|
|
|
|
|
|
|
Generated by the [Very Good CLI][very_good_cli_link] 🤖
|
|
|
|
A Pinball game built with [Flutter][flutter_link] and [Firebase][firebase_link] for [Google I/O 2022][google_io_link].
|
|
|
|
|
|
|
|
|
|
|
|
Google I/O 2022 Pinball game built with Flutter and Firebase
|
|
|
|
[Try it now][pinball_link] and [learn about how it's made][blog_link].
|
|
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
_Built by [Very Good Ventures][very_good_ventures_link] in partnership with Google_
|
|
|
|
|
|
|
|
|
|
|
|
## Getting Started 🚀
|
|
|
|
_Created using [Very Good CLI][very_good_cli_link] 🤖_
|
|
|
|
|
|
|
|
|
|
|
|
This project contains 3 flavors:
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
|
|
- development
|
|
|
|
## Getting Started 🚀
|
|
|
|
- staging
|
|
|
|
|
|
|
|
- production
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
To run the desired flavor either use the launch configuration in VSCode/Android Studio or use the following commands:
|
|
|
|
To run the desired project either use the launch configuration in VSCode/Android Studio or use the following commands:
|
|
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
```sh
|
|
|
|
# Development
|
|
|
|
$ flutter run -d chrome
|
|
|
|
$ flutter run --flavor development --target lib/main_development.dart
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Staging
|
|
|
|
|
|
|
|
$ flutter run --flavor staging --target lib/main_staging.dart
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Production
|
|
|
|
|
|
|
|
$ flutter run --flavor production --target lib/main_production.dart
|
|
|
|
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
_\*Pinball works on iOS, Android, Web, and Windows._
|
|
|
|
_\*I/O Pinball works on Web for desktop and mobile._
|
|
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
|
@ -48,7 +42,6 @@ To view the generated coverage report you can use [lcov](https://github.com/linu
|
|
|
|
```sh
|
|
|
|
```sh
|
|
|
|
# Generate Coverage Report
|
|
|
|
# Generate Coverage Report
|
|
|
|
$ genhtml coverage/lcov.info -o coverage/
|
|
|
|
$ genhtml coverage/lcov.info -o coverage/
|
|
|
|
|
|
|
|
|
|
|
|
# Open Coverage Report
|
|
|
|
# Open Coverage Report
|
|
|
|
$ open coverage/index.html
|
|
|
|
$ open coverage/index.html
|
|
|
|
```
|
|
|
|
```
|
|
|
@ -101,22 +94,6 @@ Widget build(BuildContext context) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### Adding Supported Locales
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Update the `CFBundleLocalizations` array in the `Info.plist` at `ios/Runner/Info.plist` to include the new locale.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```xml
|
|
|
|
|
|
|
|
...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<key>CFBundleLocalizations</key>
|
|
|
|
|
|
|
|
<array>
|
|
|
|
|
|
|
|
<string>en</string>
|
|
|
|
|
|
|
|
<string>es</string>
|
|
|
|
|
|
|
|
</array>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
...
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Adding Translations
|
|
|
|
### Adding Translations
|
|
|
|
|
|
|
|
|
|
|
|
1. For each supported locale, add a new ARB file in `lib/l10n/arb`.
|
|
|
|
1. For each supported locale, add a new ARB file in `lib/l10n/arb`.
|
|
|
@ -154,38 +131,20 @@ Update the `CFBundleLocalizations` array in the `Info.plist` at `ios/Runner/Info
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### Deploy application to Firebase hosting
|
|
|
|
[build_status_badge]: https://github.com/flutter/pinball/actions/workflows/main.yaml/badge.svg
|
|
|
|
|
|
|
|
|
|
|
|
Follow the following steps to deploy the application.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Firebase CLI
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Install and authenticate with [Firebase CLI tools](https://firebase.google.com/docs/cli)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Build the project using the desired environment
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
|
|
# Development
|
|
|
|
|
|
|
|
$ flutter build web --release --target lib/main_development.dart
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Staging
|
|
|
|
|
|
|
|
$ flutter build web --release --target lib/main_staging.dart
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Production
|
|
|
|
|
|
|
|
$ flutter build web --release --target lib/main_production.dart
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Deploy
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
|
|
$ firebase deploy
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[coverage_badge]: coverage_badge.svg
|
|
|
|
[coverage_badge]: coverage_badge.svg
|
|
|
|
|
|
|
|
[firebase_link]: https://firebase.google.com/
|
|
|
|
|
|
|
|
[flutter_link]: https://flutter.dev
|
|
|
|
[flutter_localizations_link]: https://api.flutter.dev/flutter/flutter_localizations/flutter_localizations-library.html
|
|
|
|
[flutter_localizations_link]: https://api.flutter.dev/flutter/flutter_localizations/flutter_localizations-library.html
|
|
|
|
|
|
|
|
[google_io_link]: https://events.google.com/io/
|
|
|
|
|
|
|
|
[blog_link]: https://medium.com/flutter/i-o-pinball-powered-by-flutter-and-firebase-d22423f3f5d
|
|
|
|
[internationalization_link]: https://flutter.dev/docs/development/accessibility-and-localization/internationalization
|
|
|
|
[internationalization_link]: https://flutter.dev/docs/development/accessibility-and-localization/internationalization
|
|
|
|
[license_badge]: https://img.shields.io/badge/license-MIT-blue.svg
|
|
|
|
[license_badge]: https://img.shields.io/badge/license-MIT-blue.svg
|
|
|
|
[license_link]: https://opensource.org/licenses/MIT
|
|
|
|
[license_link]: https://opensource.org/licenses/MIT
|
|
|
|
|
|
|
|
[logo]: art/readme_header.png
|
|
|
|
|
|
|
|
[pinball_link]: https://pinball.flutter.dev
|
|
|
|
[very_good_analysis_badge]: https://img.shields.io/badge/style-very_good_analysis-B22C89.svg
|
|
|
|
[very_good_analysis_badge]: https://img.shields.io/badge/style-very_good_analysis-B22C89.svg
|
|
|
|
[very_good_analysis_link]: https://pub.dev/packages/very_good_analysis
|
|
|
|
[very_good_analysis_link]: https://pub.dev/packages/very_good_analysis
|
|
|
|
[very_good_cli_link]: https://github.com/VeryGoodOpenSource/very_good_cli
|
|
|
|
[very_good_cli_link]: https://github.com/VeryGoodOpenSource/very_good_cli
|
|
|
|
|
|
|
|
[very_good_ventures_link]: https://verygood.ventures/
|
|
|
|
|
|
|
|
[workflow_link]: https://github.com/flutter/pinball/actions/workflows/main.yaml
|
|
|
|