Skip to content
Snippets Groups Projects
Commit 6f739c53 authored by Benoît Harrault's avatar Benoît Harrault
Browse files

Merge branch '20-normalize-activity-application-architecture' into 'master'

Resolve "Normalize Activity application architecture"

Closes #20

See merge request !18
parents 5669f4e0 6775c64b
No related branches found
No related tags found
1 merge request!18Resolve "Normalize Activity application architecture"
Pipeline #6780 passed
import 'package:flutter/material.dart';
import 'package:flutter_custom_toolbox/flutter_toolbox.dart';
import 'package:awale/cubit/game_cubit.dart';
import 'package:awale/models/game/game.dart';
import 'package:awale/cubit/activity/activity_cubit.dart';
import 'package:awale/models/activity/activity.dart';
class GameScoreWidget extends StatelessWidget {
const GameScoreWidget({
......@@ -14,11 +14,11 @@ class GameScoreWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return BlocBuilder<GameCubit, GameState>(
builder: (BuildContext context, GameState gameState) {
final Game currentGame = gameState.currentGame;
return BlocBuilder<ActivityCubit, ActivityState>(
builder: (BuildContext context, ActivityState activityState) {
final Activity currentActivity = activityState.currentActivity;
final bool isCurrentPlayer = (currentGame.currentPlayer == playerIndex);
final bool isCurrentPlayer = (currentActivity.currentPlayer == playerIndex);
final baseColor =
isCurrentPlayer ? Colors.white : const Color.fromARGB(255, 230, 230, 230);
......@@ -40,7 +40,7 @@ class GameScoreWidget extends StatelessWidget {
child: Padding(
padding: const EdgeInsets.fromLTRB(0, 65, 0, 0),
child: Text(
currentGame.scores[playerIndex].toString(),
currentActivity.scores[playerIndex].toString(),
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 40,
......
......@@ -3,8 +3,8 @@ import 'dart:math';
import 'package:flutter/material.dart';
import 'package:flutter_custom_toolbox/flutter_toolbox.dart';
import 'package:awale/cubit/game_cubit.dart';
import 'package:awale/models/game/game.dart';
import 'package:awale/cubit/activity/activity_cubit.dart';
import 'package:awale/models/activity/activity.dart';
class GameSeedsWidget extends StatelessWidget {
const GameSeedsWidget({
......@@ -16,10 +16,10 @@ class GameSeedsWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return BlocBuilder<GameCubit, GameState>(
builder: (BuildContext context, GameState gameState) {
final Game currentGame = gameState.currentGame;
final String skin = currentGame.globalSettings.skin;
return BlocBuilder<ActivityCubit, ActivityState>(
builder: (BuildContext context, ActivityState activityState) {
final Activity currentActivity = activityState.currentActivity;
final String skin = currentActivity.globalSettings.skin;
const ratioScale = 0.2;
const ratioTranslate = 0.65;
......
......@@ -245,10 +245,10 @@ packages:
dependency: transitive
description:
name: path_provider
sha256: fec0d61223fba3154d87759e3cc27fe2c8dc498f6386c6d6fc80d1afdd1bf378
sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd"
url: "https://pub.dev"
source: hosted
version: "2.1.4"
version: "2.1.5"
path_provider_android:
dependency: transitive
description:
......@@ -442,10 +442,10 @@ packages:
dependency: transitive
description:
name: win32
sha256: "2735daae5150e8b1dfeb3eb0544b4d3af0061e9e82cef063adcd583bdae4306a"
sha256: "10169d3934549017f0ae278ccb07f828f9d6ea21573bab0fb77b0e1ef0fce454"
url: "https://pub.dev"
source: hosted
version: "5.7.0"
version: "5.7.2"
xdg_directories:
dependency: transitive
description:
......
......@@ -3,7 +3,7 @@ description: Awale game
publish_to: "none"
version: 0.2.1+15
version: 0.3.0+16
environment:
sdk: "^3.0.0"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment