Skip to content

Commit

Permalink
wasm
Browse files Browse the repository at this point in the history
  • Loading branch information
renancaraujo committed Aug 31, 2024
1 parent 71a5d6c commit a695e00
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 858 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ coverage/
packages/**/pubspec.lock

# Web related
lib/generated_plugin_registrant.dart

# Symbolication related
app.*.symbols
Expand Down
30 changes: 15 additions & 15 deletions .metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# This file should be version controlled and should not be manually edited.

version:
revision: "ba393198430278b6595976de84fe170f553cc728"
revision: "5dcb86f68f239346676ceb1ed1ea385bd215fba1"
channel: "stable"

project_type: app
Expand All @@ -13,26 +13,26 @@ project_type: app
migration:
platforms:
- platform: root
create_revision: ba393198430278b6595976de84fe170f553cc728
base_revision: ba393198430278b6595976de84fe170f553cc728
create_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1
base_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1
- platform: android
create_revision: ba393198430278b6595976de84fe170f553cc728
base_revision: ba393198430278b6595976de84fe170f553cc728
create_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1
base_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1
- platform: ios
create_revision: ba393198430278b6595976de84fe170f553cc728
base_revision: ba393198430278b6595976de84fe170f553cc728
create_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1
base_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1
- platform: linux
create_revision: ba393198430278b6595976de84fe170f553cc728
base_revision: ba393198430278b6595976de84fe170f553cc728
create_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1
base_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1
- platform: macos
create_revision: ba393198430278b6595976de84fe170f553cc728
base_revision: ba393198430278b6595976de84fe170f553cc728
create_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1
base_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1
- platform: web
create_revision: ba393198430278b6595976de84fe170f553cc728
base_revision: ba393198430278b6595976de84fe170f553cc728
create_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1
base_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1
- platform: windows
create_revision: ba393198430278b6595976de84fe170f553cc728
base_revision: ba393198430278b6595976de84fe170f553cc728
create_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1
base_revision: 5dcb86f68f239346676ceb1ed1ea385bd215fba1

# User provided section

Expand Down
11 changes: 2 additions & 9 deletions lib/bootstrap.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import 'package:crystal_ball/gen/assets.gen.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';
import 'package:hydrated_bloc/hydrated_bloc.dart';
import 'package:path_provider/path_provider.dart';
import 'package:flutter_bloc/flutter_bloc.dart';


class AppBlocObserver extends BlocObserver {
@override
Expand All @@ -33,13 +33,6 @@ Future<void> bootstrap(FutureOr<Widget> Function() builder) async {
};

WidgetsFlutterBinding.ensureInitialized();
final storage = await HydratedStorage.build(
storageDirectory: kIsWeb
? HydratedStorage.webStorageDirectory
: await getApplicationDocumentsDirectory(),
);

HydratedBloc.storage = storage;

Bloc.observer = AppBlocObserver();

Expand Down
38 changes: 21 additions & 17 deletions lib/game/view/game_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -108,23 +108,23 @@ class _GameViewState extends State<GameView> {
return ColoredBox(
color: Colors.black,
child: GameWidget(
backgroundBuilder: (context) {
return const Center(
child: AspectRatio(
aspectRatio: 9 / 16,
child: DynamicBackground(),
),
);
},
// backgroundBuilder: (context) {
// return const Center(
// child: AspectRatio(
// aspectRatio: 9 / 16,
// child: DynamicBackground(),
// ),
// );
// },
overlayBuilderMap: {
'vignette': (context, game) {
return const Center(
child: AspectRatio(
aspectRatio: 9 / 16,
child: MeshVigenette(),
),
);
},
// 'vignette': (context, game) {
// return const Center(
// child: AspectRatio(
// aspectRatio: 9 / 16,
// child: MeshVigenette(),
// ),
// );
// },
'score': (context, game) {
return const Center(
child: AspectRatio(
Expand All @@ -148,7 +148,11 @@ class _GameViewState extends State<GameView> {
);
},
},
initialActiveOverlays: const ['vignette', 'score', 'highscore'],
initialActiveOverlays: const [
// 'vignette',
'score',
'highscore',
],
game: _game!,
),
);
Expand Down
2 changes: 1 addition & 1 deletion macos/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Cocoa
import FlutterMacOS

@NSApplicationMain
@main
class AppDelegate: FlutterAppDelegate {
override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
return true
Expand Down
Loading

0 comments on commit a695e00

Please sign in to comment.