From ff876ef0583b6bc5eb8d0aab70e1ae0a583bc721 Mon Sep 17 00:00:00 2001 From: Luan Nico Date: Mon, 14 Oct 2019 19:06:50 -0400 Subject: [PATCH] fix debug example app --- doc/examples/debug/lib/main.dart | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/doc/examples/debug/lib/main.dart b/doc/examples/debug/lib/main.dart index 0d5e536f2..fb3f35805 100644 --- a/doc/examples/debug/lib/main.dart +++ b/doc/examples/debug/lib/main.dart @@ -11,7 +11,9 @@ import 'package:flutter/material.dart'; void main() async { await Flame.util.initialDimensions(); - runApp(MyGame().widget); + final myGame = MyGame(); + runApp(myGame.widget); + myGame.start(); } class AndroidComponent extends SvgComponent with Resizable { @@ -48,14 +50,10 @@ class AndroidComponent extends SvgComponent with Resizable { class MyGame extends BaseGame { final fpsTextConfig = const TextConfig(color: const Color(0xFFFFFFFF)); - MyGame() { - _start(); - } - @override bool debugMode() => true; - void _start() { + void start() { final android = AndroidComponent(); android.x = 100; android.y = 400;