Reusable Flutter package that contains the Math Games module (home + mini-games) for embedding inside a parent app.
MathGamesQuestpack.init()to initialize local prefs used by gamesMathGamesQuestpack.routes()to plug module routes into a host app using named routesMathGamesQuestpackAppfor standalone local/dev run
import 'package:math_games_questpack_flutter/math_games_questpack_flutter.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
await MathGamesQuestpack.init();
}MaterialApp(
initialRoute: GameRouteNames.home,
routes: {
// host routes...
...MathGamesQuestpack.routes(),
},
);If your app already uses only onGenerateRoute, delegate unknown routes:
Route<dynamic>? onGenerateRoute(RouteSettings settings) {
// host switch/cases...
final moduleRoute = createMathGamesOnGenerateRoute(settings);
if (moduleRoute != null) return moduleRoute;
return null;
}This repo still includes lib/main.dart for direct local testing:
flutter run