Skip to content
Snippets Groups Projects
Select Git revision
  • 11971731f4772a8763a462868e92a8da113790b3
  • 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
  • game.dart 2.86 KiB
    import 'package:flutter/material.dart';
    
    import '../provider/data.dart';
    import '../utils/game_utils.dart';
    
    class Game {
      static Container buildGameWidget(Data myProvider) {
        bool gameIsFinished = myProvider.isGameFinished();
    
        return Container(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.start,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: [
              SizedBox(height: 8),
              Game.buildTopIndicatorWidget(myProvider),
              SizedBox(height: 2),
              Expanded(
                child: Text('GAME'),
              ),
              SizedBox(height: 2),
              Container(
                height: 150,
                width: double.maxFinite,
                child: gameIsFinished ? Game.buildEndGameMessage(myProvider) : Text('CONTROLS'),
              ),
            ],
          ),
        );
      }
    
      static Widget buildTopIndicatorWidget(Data myProvider) {
        return Table(
          children: [
            TableRow(
              children: [
                Column(children: [
                  Text(
                    'SCORE',
                    style: TextStyle(
                      fontSize: 40,
                      fontWeight: FontWeight.w600,
                      color: Colors.black,
                    ),
                  ),
                  Text(
                    'TARGET',
                    style: TextStyle(
                      fontSize: 15,
                      fontWeight: FontWeight.w600,
                      color: Colors.grey,
                    ),
                  ),
                ]),
                Column(children: [
                  Text(
                    'INFOS',
                    style: TextStyle(
                      fontSize: 20,
                      fontWeight: FontWeight.w600,
                      color: Colors.green,
                    ),
                  ),
                ]),
              ],
            ),
          ],
        );
      }