mirror of
				https://github.com/flame-engine/flame.git
				synced 2025-11-01 01:18:38 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			46 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Dart
		
	
	
	
	
	
			
		
		
	
	
			46 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			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;
 | |
| import 'package:tutorials_space_shooter/step4/main.dart' as step4;
 | |
| import 'package:tutorials_space_shooter/step5/main.dart' as step5;
 | |
| import 'package:tutorials_space_shooter/step6/main.dart' as step6;
 | |
| 
 | |
| 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;
 | |
|     case 'step4':
 | |
|       step4.main();
 | |
|       break;
 | |
|     case 'step5':
 | |
|       step5.main();
 | |
|       break;
 | |
|     case 'step6':
 | |
|       step6.main();
 | |
|       break;
 | |
| 
 | |
|     default:
 | |
|       runApp(
 | |
|         Directionality(
 | |
|           textDirection: TextDirection.ltr,
 | |
|           child: Text('Error: unknown page name "$page"'),
 | |
|         ),
 | |
|       );
 | |
|   }
 | |
| }
 | 
