diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 82d8fae0..f260a028 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -21,7 +21,7 @@ jobs: - name: Build Flutter App run: | flutter packages get - flutter build web --target lib/main_development.dart --web-renderer canvaskit --release + flutter build web --target lib/main.dart --web-renderer canvaskit --release - name: Deploy to Firebase uses: FirebaseExtended/action-hosting-deploy@v0 diff --git a/.idea/runConfigurations/development.xml b/.idea/runConfigurations/development.xml deleted file mode 100644 index 37d45fe3..00000000 --- a/.idea/runConfigurations/development.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/runConfigurations/main.xml b/.idea/runConfigurations/main.xml new file mode 100644 index 00000000..b5c260ef --- /dev/null +++ b/.idea/runConfigurations/main.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/production.xml b/.idea/runConfigurations/production.xml deleted file mode 100644 index e55961d8..00000000 --- a/.idea/runConfigurations/production.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/runConfigurations/staging.xml b/.idea/runConfigurations/staging.xml deleted file mode 100644 index 3f7d6219..00000000 --- a/.idea/runConfigurations/staging.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json index 1b855b10..e2ea6cee 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -5,30 +5,10 @@ "version": "0.2.0", "configurations": [ { - "name": "Launch development", + "name": "Launch pinball", "request": "launch", "type": "dart", - "program": "lib/main_development.dart", - "args": [ - "--flavor", - "development", - "--target", - "lib/main_development.dart" - ] - }, - { - "name": "Launch staging", - "request": "launch", - "type": "dart", - "program": "lib/main_staging.dart", - "args": ["--flavor", "staging", "--target", "lib/main_staging.dart"] - }, - { - "name": "Launch production", - "request": "launch", - "type": "dart", - "program": "lib/main_production.dart", - "args": ["--flavor", "production", "--target", "lib/main_production.dart"] + "program": "lib/main.dart" }, { "name": "Launch component sandbox", diff --git a/README.md b/README.md index b91a1c98..957cb05b 100644 --- a/README.md +++ b/README.md @@ -1,37 +1,31 @@ -# Pinball +# I/O Pinball +[![Pinball Header][logo]][pinball_link] + +[![io_pinball][build_status_badge]][workflow_link] ![coverage][coverage_badge] [![style: very good analysis][very_good_analysis_badge]][very_good_analysis_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 -- staging -- production +## Getting Started 🚀 -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 -# Development -$ 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 +$ flutter run -d chrome ``` -_\*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 # Generate Coverage Report $ genhtml coverage/lcov.info -o coverage/ - # Open Coverage Report $ 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 - ... - - CFBundleLocalizations - - en - es - - - ... -``` - ### Adding Translations 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 - -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 -``` - +[build_status_badge]: https://github.com/flutter/pinball/actions/workflows/main.yaml/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 +[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 [license_badge]: https://img.shields.io/badge/license-MIT-blue.svg [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_link]: https://pub.dev/packages/very_good_analysis [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 diff --git a/art/readme_header.png b/art/readme_header.png new file mode 100644 index 00000000..43e7fb53 Binary files /dev/null and b/art/readme_header.png differ diff --git a/lib/main_development.dart b/lib/main.dart similarity index 100% rename from lib/main_development.dart rename to lib/main.dart diff --git a/lib/main_production.dart b/lib/main_production.dart deleted file mode 100644 index 158966c8..00000000 --- a/lib/main_production.dart +++ /dev/null @@ -1,26 +0,0 @@ -import 'dart:async'; - -import 'package:authentication_repository/authentication_repository.dart'; -import 'package:firebase_core/firebase_core.dart'; -import 'package:leaderboard_repository/leaderboard_repository.dart'; -import 'package:pinball/app/app.dart'; -import 'package:pinball/bootstrap.dart'; -import 'package:pinball_audio/pinball_audio.dart'; - -void main() { - bootstrap((firestore, firebaseAuth) async { - final leaderboardRepository = LeaderboardRepository(firestore); - final authenticationRepository = AuthenticationRepository(firebaseAuth); - final pinballAudioPlayer = PinballAudioPlayer(); - unawaited( - Firebase.initializeApp().then( - (_) => authenticationRepository.authenticateAnonymously(), - ), - ); - return App( - authenticationRepository: authenticationRepository, - leaderboardRepository: leaderboardRepository, - pinballAudioPlayer: pinballAudioPlayer, - ); - }); -} diff --git a/lib/main_staging.dart b/lib/main_staging.dart deleted file mode 100644 index 158966c8..00000000 --- a/lib/main_staging.dart +++ /dev/null @@ -1,26 +0,0 @@ -import 'dart:async'; - -import 'package:authentication_repository/authentication_repository.dart'; -import 'package:firebase_core/firebase_core.dart'; -import 'package:leaderboard_repository/leaderboard_repository.dart'; -import 'package:pinball/app/app.dart'; -import 'package:pinball/bootstrap.dart'; -import 'package:pinball_audio/pinball_audio.dart'; - -void main() { - bootstrap((firestore, firebaseAuth) async { - final leaderboardRepository = LeaderboardRepository(firestore); - final authenticationRepository = AuthenticationRepository(firebaseAuth); - final pinballAudioPlayer = PinballAudioPlayer(); - unawaited( - Firebase.initializeApp().then( - (_) => authenticationRepository.authenticateAnonymously(), - ), - ); - return App( - authenticationRepository: authenticationRepository, - leaderboardRepository: leaderboardRepository, - pinballAudioPlayer: pinballAudioPlayer, - ); - }); -}