gameAppCreator method
void
gameAppCreator()
Implementation
void gameAppCreator() {
var gameAppContent = '''
import 'package:flutter/material.dart';
class GameApp extends StatefulWidget {
// Constructor for the GameApp widget.
const GameApp({super.key});
// Creates the mutable state for this widget.
@override
State<GameApp> createState() => _GameAppState();
}
// The state class for GameApp.
class _GameAppState extends State<GameApp> {
@override
void initState() {
super.initState();
// initState is a lifecycle method that is called when the state is initialized.
// You can perform any initialization tasks here.
}
@override
Widget build(BuildContext context) {
// build is a required method that returns the widget tree for this state.
// It describes the part of the user interface represented by this state.
return MaterialApp(); // Returns a MaterialApp widget.
}
}
''';
var gameAppFile = File('$name/lib/src/widgets/game_app.dart');
gameAppFile.createSync(recursive: true);
gameAppFile.writeAsStringSync(gameAppContent);
}