import 'package:flutter/material.dart'; import 'package:wolf_3d_data_types/wolf_3d_data_types.dart'; import 'package:wolf_dart/features/difficulty/difficulty.dart'; import 'package:wolf_dart/features/renderer/renderer.dart'; class DifficultyScreen extends StatelessWidget { const DifficultyScreen( this.data, { super.key, }); final WolfensteinData data; bool get isShareware => data.version == GameVersion.shareware; @override Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.black, floatingActionButton: FloatingActionButton( backgroundColor: Colors.red[900], onPressed: () { Navigator.of(context).push( MaterialPageRoute( builder: (_) => WolfRenderer( data, difficulty: Difficulty.bringEmOn, isShareware: isShareware, showSpriteGallery: true, ), ), ); }, child: const Icon(Icons.bug_report, color: Colors.white), ), body: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ const Text( 'HOW TOUGH ARE YOU?', style: TextStyle( color: Colors.red, fontSize: 32, fontWeight: FontWeight.bold, fontFamily: 'Courier', ), ), // --- Difficulty Buttons --- ListView.builder( shrinkWrap: true, itemCount: Difficulty.values.length, itemBuilder: (context, index) { final Difficulty difficulty = Difficulty.values[index]; return Padding( padding: const EdgeInsets.symmetric(vertical: 8.0), child: ElevatedButton( style: ElevatedButton.styleFrom( backgroundColor: Colors.blueGrey[900], foregroundColor: Colors.white, minimumSize: const Size(300, 50), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(4), ), ), onPressed: () { Navigator.of(context).pushReplacement( MaterialPageRoute( builder: (_) => WolfRenderer( data, difficulty: difficulty, isShareware: isShareware, ), ), ); }, child: Text( difficulty.title, style: const TextStyle(fontSize: 18), ), ), ); }, ), ], ), ), ); } }