Files
Erick 6c1b568d01 docs: SpaceShooter tutorial step 3 (#2919)
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>
2023-12-15 09:30:27 -03:00

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"'),
),
);
}
}