Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/functions/jose-2.0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
astivi authored Jul 8, 2024
2 parents 63c548c + 91965f8 commit e2fb9e5
Show file tree
Hide file tree
Showing 285 changed files with 6,720 additions and 4,183 deletions.
5 changes: 0 additions & 5 deletions .firebaserc

This file was deleted.

3 changes: 0 additions & 3 deletions .github/CODEOWNERS

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/flutter_package.yml@v1
with:
flutter_channel: stable
flutter_version: 2.10.5
flutter_version: 3.22.2
coverage_excludes: "lib/gen/*.dart"
test_optimization: false

2 changes: 1 addition & 1 deletion .github/workflows/spell_check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Check spelling
uses: zwaldowski/cspell-action@v1
Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,14 @@ unlinked_spec.ds
# Coverage
coverage/

# Golden tests related
**/failures

# Submodules
!pubspec.lock
packages/**/pubspec.lock

# Web related
lib/generated_plugin_registrant.dart

# Symbolication related
app.*.symbols
Expand All @@ -128,6 +130,8 @@ app.*.map.json

# Firebase related
.firebase
firebase.json
lib/firebase_options.dart

test/.test_runner.dart
web/__/firebase/init.js
4 changes: 3 additions & 1 deletion .vscode/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@
"dpad",
"endtemplate",
"firestore",
"flutterfire",
"gapless",
"genhtml",
"goldens",
"lcov",
"leaderboard",
"loadables",
"localizable",
"macos",
"mixins",
"mocktail",
"mostrado",
Expand All @@ -47,4 +49,4 @@
"ignorePaths": [
".github/workflows/**"
]
}
}
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,17 @@ _Created using [Very Good CLI][very_good_cli_link] 🤖_

## Getting Started 🚀

### Firebase
First, please create a Firebase project for development.
After you create your project, remember to activate the following features:
- **Authentication** with the **anonymous** option
- **Firestore** with the rules in firestore.rules.

Next, use the instructions on [Firebase website](https://firebase.google.com/docs/flutter/setup?platform=web) to set up the **flutterfire_cli**.

Allow it to override the **lib/firebase_options.dart** file with your project settings.

### Running locally
To run the desired project either use the launch configuration in VSCode/Android Studio or use the following commands:

```sh
Expand Down
4 changes: 4 additions & 0 deletions devtools_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
description: This file stores settings for Dart & Flutter DevTools.
documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states
extensions:
- flame: true
33 changes: 0 additions & 33 deletions firebase.json

This file was deleted.

1 change: 1 addition & 0 deletions lib/assets_manager/cubit/assets_manager_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class AssetsManagerCubit extends Cubit<AssetsManagerState> {
/// do its job without adding too much delay for the user, we are letting
/// the UI paint first, and then we start loading the assets.
await Future<void>.delayed(const Duration(seconds: 1));
if (isClosed) return;
final loadables = <Future<void> Function()>[
_game.preFetchLeaderboard,
..._game.preLoadAssets(),
Expand Down
4 changes: 2 additions & 2 deletions lib/assets_manager/views/assets_loading_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class AssetsLoadingPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
final l10n = context.l10n;
final headline1 = Theme.of(context).textTheme.headline1;
final displayLarge = Theme.of(context).textTheme.displayLarge;
return Container(
decoration: const CrtBackground(),
child: Center(
Expand All @@ -30,7 +30,7 @@ class AssetsLoadingPage extends StatelessWidget {
const SizedBox(height: 40),
AnimatedEllipsisText(
l10n.loading,
style: headline1,
style: displayLarge,
),
const SizedBox(height: 40),
FractionallySizedBox(
Expand Down
31 changes: 0 additions & 31 deletions lib/bootstrap.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import 'dart:async';
import 'dart:developer';

import 'package:bloc/bloc.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/widgets.dart';

class AppBlocObserver extends BlocObserver {
@override
Expand All @@ -19,30 +15,3 @@ class AppBlocObserver extends BlocObserver {
super.onError(bloc, error, stackTrace);
}
}

typedef BootstrapBuilder = Future<Widget> Function(
FirebaseFirestore firestore,
FirebaseAuth firebaseAuth,
);

Future<void> bootstrap(BootstrapBuilder builder) async {
WidgetsFlutterBinding.ensureInitialized();
FlutterError.onError = (details) {
log(details.exceptionAsString(), stackTrace: details.stack);
};

await runZonedGuarded(
() async {
await BlocOverrides.runZoned(
() async => runApp(
await builder(
FirebaseFirestore.instance,
FirebaseAuth.instance,
),
),
blocObserver: AppBlocObserver(),
);
},
(error, stackTrace) => log(error.toString(), stackTrace: stackTrace),
);
}
63 changes: 63 additions & 0 deletions lib/firebase_options.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// File generated by FlutterFire CLI.
// ignore_for_file: type=lint
import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
import 'package:flutter/foundation.dart'
show defaultTargetPlatform, kIsWeb, TargetPlatform;

/// Default [FirebaseOptions] for use with your Firebase apps.
///
/// Example:
/// ```dart
/// import 'firebase_options.dart';
/// // ...
/// await Firebase.initializeApp(
/// options: DefaultFirebaseOptions.currentPlatform,
/// );
/// ```
class DefaultFirebaseOptions {
static FirebaseOptions get currentPlatform {
if (kIsWeb) {
return web;
}
switch (defaultTargetPlatform) {
case TargetPlatform.android:
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for android - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
case TargetPlatform.iOS:
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for ios - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
case TargetPlatform.macOS:
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for macos - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
case TargetPlatform.windows:
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for windows - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
case TargetPlatform.linux:
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for linux - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
default:
throw UnsupportedError(
'DefaultFirebaseOptions are not supported for this platform.',
);
}
}

static const FirebaseOptions web = FirebaseOptions(
apiKey: '',
appId: '',
messagingSenderId: '',
projectId: '',
authDomain: '',
storageBucket: '',
);
}
5 changes: 2 additions & 3 deletions lib/game/behaviors/animatronic_looping_behavior.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:flame/components.dart';
import 'package:pinball_flame/pinball_flame.dart';

class AnimatronicLoopingBehavior extends TimerComponent
with ParentIsA<SpriteAnimationComponent> {
Expand All @@ -10,8 +9,8 @@ class AnimatronicLoopingBehavior extends TimerComponent
@override
Future<void> onLoad() async {
await super.onLoad();
parent.animation?.onComplete = () {
parent.animation?.reset();
parent.animationTicker?.onComplete = () {
parent.animationTicker?.reset();
parent.playing = false;
timer
..reset()
Expand Down
11 changes: 4 additions & 7 deletions lib/game/behaviors/camera_focusing_behavior.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import 'package:flame/components.dart';
import 'package:flame/game.dart';
import 'package:flame_bloc/flame_bloc.dart';
import 'package:pinball/game/game.dart';
import 'package:pinball_components/pinball_components.dart';

/// {@template focus_data}
/// Defines a [Camera] focus point.
/// Defines a [CameraComponent] focus point.
/// {@endtemplate}
class _FocusData {
/// {@macro focus_data}
Expand Down Expand Up @@ -69,16 +68,14 @@ class CameraFocusingBehavior extends Component
@override
Future<void> onLoad() async {
await super.onLoad();
onGameResize(gameRef.camera.viewport.size);
_snap(GameStatus.waiting);
}

void _snap(GameStatus focusKey) {
final focusData = _foci[_activeFocus = focusKey]!;

gameRef.camera
..speed = 100
..followVector2(focusData.position)
..zoom = focusData.zoom;
gameRef.camera.moveTo(focusData.position, speed: 100);
gameRef.camera.viewfinder.zoom = focusData.zoom;
}

void _zoomTo(GameStatus focusKey) {
Expand Down
6 changes: 5 additions & 1 deletion lib/game/components/backbox/backbox.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ class Backbox extends PositionComponent with ZIndex, HasGameRef {
_build(_bloc.state);

_subscription = _bloc.stream.listen((state) {
_display.children.removeWhere((_) => true);
final removals = _display.children.map((child) {
_display.remove(child);
return child.removed;
});
Future.wait(removals);
_build(state);
});
}
Expand Down
2 changes: 1 addition & 1 deletion lib/game/components/backbox/bloc/backbox_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ part of 'backbox_bloc.dart';

/// {@template backbox_state}
/// The base state for all [BackboxState].
/// {@endtemplate backbox_state}
/// {@endtemplate}
abstract class BackboxState extends Equatable {
/// {@macro backbox_state}
const BackboxState();
Expand Down
Loading

0 comments on commit e2fb9e5

Please sign in to comment.