Skip to content
Snippets Groups Projects
Select Git revision
  • 868bb1d976d4a29cd6f11af01c0b48f80e647522
  • master default protected
  • 21-add-onlongpress-with-popup-on-parameters
  • 23-center-vertically-buttons
  • 30-highlight-bin-when-selecting-disabled-item
  • 1.0.7 protected
  • 1.0.6 protected
  • 1.0.5 protected
  • 1.0.4 protected
  • 1.0.3 protected
  • 1.0.2 protected
  • 1.0.0 protected
  • 0.9.1 protected
  • 0.9.0 protected
  • 0.8.4 protected
  • 0.8.3 protected
  • 0.8.2 protected
  • 0.8.1 protected
  • 0.8.0 protected
  • 0.7.0 protected
  • 0.6.1 protected
  • 0.6.0 protected
  • 0.5.0 protected
  • 0.4.0 protected
  • 0.3.0 protected
25 results

pubspec.yaml

Blame
  • match_page.dart 7.53 KiB
    import 'dart:math';
    
    import 'package:flutter/material.dart';
    import 'package:puissance4/coordinate.dart';
    
    import 'board.dart';
    import 'cpu.dart';
    import 'game_chip.dart';
    import 'hole_painter.dart';
    
    enum Color {
      YELLOW,
      RED,
    }
    
    enum Mode {
      PVP,
      PVC,
      DEMO,
    }
    
    class MatchPage extends StatefulWidget {
      final Mode mode;
      final Cpu cpu;
      final Cpu cpu2;
    
      const MatchPage({
        Key key,
        this.mode,
        this.cpu,
        this.cpu2,
      }) : super(key: key);
    
      @override
      _MatchPageState createState() => _MatchPageState();
    }
    
    class _MatchPageState extends State<MatchPage> with TickerProviderStateMixin {
      final board = Board();
      Color turn;
      Color winner;
    
      List<List<Animation<double>>> translations = List.generate(
        7,
        (i) => List.generate(
          7,
          (i) => null,
        ),
      );
    
      @override
      Widget build(BuildContext context) {
        return Scaffold(
          appBar: AppBar(
            elevation: 0,
          ),
          backgroundColor: Colors.blue,
          body: Padding(
            padding: const EdgeInsets.all(16.0),
            child: Flex(
              direction: Axis.vertical,
              mainAxisSize: MainAxisSize.max,
              children: <Widget>[
                Flexible(
                  flex: 2,
                  child: Container(
                    constraints: BoxConstraints.loose(
                      Size(
                        500,
                        532,