mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-01 19:12:31 +08:00
After a long time, the PR with the step 3 for the space shooter tutorial! Replace or remove this text. --------- Co-authored-by: Lukas Klingsbo <me@lukas.fyi>
34 lines
778 B
Dart
34 lines
778 B
Dart
import 'dart:html'; // ignore: avoid_web_libraries_in_flutter
|
|
|
|
import 'package:flutter/widgets.dart';
|
|
import 'package:tutorials_space_shooter/step1/main.dart' as step1;
|
|
import 'package:tutorials_space_shooter/step2/main.dart' as step2;
|
|
import 'package:tutorials_space_shooter/step3/main.dart' as step3;
|
|
|
|
void main() {
|
|
var page = window.location.search ?? '';
|
|
if (page.startsWith('?')) {
|
|
page = page.substring(1);
|
|
}
|
|
|
|
switch (page) {
|
|
case 'step1':
|
|
step1.main();
|
|
break;
|
|
case 'step2':
|
|
step2.main();
|
|
break;
|
|
case 'step3':
|
|
step3.main();
|
|
break;
|
|
|
|
default:
|
|
runApp(
|
|
Directionality(
|
|
textDirection: TextDirection.ltr,
|
|
child: Text('Error: unknown page name "$page"'),
|
|
),
|
|
);
|
|
}
|
|
}
|