Select Git revision
submit.dart
-
Benoît Harrault authoredBenoît Harrault authored
home_page.dart 2.61 KiB
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:puissance4/cpu.dart';
import 'match_page.dart';
class HomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.blue,
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
TextButton(
style: TextButton.styleFrom(
backgroundColor: Colors.green,
padding: EdgeInsets.all(15),
),
child: Text(
'🧑 2 JOUEURS 🧑',
style:
Theme.of(context).textTheme.headline4?.copyWith(color: Colors.white),
),
onPressed: () {
Navigator.pushNamed(
context,
'/match',
arguments: {
'mode': Mode.PVP,
},
);
},
),
TextButton(
style: TextButton.styleFrom(
backgroundColor: Colors.orange,
padding: EdgeInsets.all(15),
),
child: Text(
'🧑 1 JOUEUR 🤖',
style:
Theme.of(context).textTheme.headline4?.copyWith(color: Colors.white),
),
onPressed: () {
Navigator.pushNamed(
context,
'/cpu-level',
arguments: {
'mode': Mode.PVC,
},
);
},
),
TextButton(
style: TextButton.styleFrom(
backgroundColor: Colors.white,
padding: EdgeInsets.all(15),
),
child: Text(
'🤖 DEMO 🤖',
style:
Theme.of(context).textTheme.headline4?.copyWith(color: Colors.black),
),
onPressed: () {
final harderCpu =