Skip to content

Commit

Permalink
Merge pull request #15 from Ayush0Chaudhary/tabtitle
Browse files Browse the repository at this point in the history
Tabtitle
  • Loading branch information
Ayush0Chaudhary authored Oct 18, 2023
2 parents 40ac8ea + 042d99e commit fdb4ce4
Show file tree
Hide file tree
Showing 11 changed files with 172 additions and 204 deletions.
2 changes: 1 addition & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ class MyApp extends StatelessWidget {
var grid = Grid();
return grid;
},
),
),
Provider<GamesServicesController?>.value(
value: gamesServicesController),
Provider<AdsController?>.value(value: adsController),
Expand Down
8 changes: 5 additions & 3 deletions lib/src/change_name/change_name_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ class ChangeNameScreen extends StatelessWidget {
rectangularMenuArea: Column(
children: [
_gap,
FilledButton(onPressed: () {
GoRouter.of(context).go('/play/session');
}, child: Text('Start'))
FilledButton(
onPressed: () {
GoRouter.of(context).go('/play/session');
},
child: Text('Start'))
],
),
),
Expand Down
8 changes: 3 additions & 5 deletions lib/src/play_session/grid_constants.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
double dot_size = 12;
double bar_size = 55;

double dot_size=12;
double bar_size=55;

const int grid_size=5;

const int grid_size = 5;
11 changes: 0 additions & 11 deletions lib/src/play_session/grid_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,29 +51,18 @@ class Grid extends ChangeNotifier {
_p2++;
}
}
for (int i = 0; i < _gridWinner.length; i++) {
print(_gridWinner[i]);
}
notifyListeners();
}

void setGridCount(int x, int y, int value) {
_gridCount[x][y] = value;
// log all grid count as a grid view
print(_gridCount);
notifyListeners();
}

void incrementGridCount(int x, int y) {
// print("$x ,$y");

if (_gridCount[x][y] != 4) {
_gridCount[x][y]++;
}
for (int i = 0; i < _gridWinner.length; i++) {
print(_gridCount[i]);
}

notifyListeners();
}

Expand Down
327 changes: 156 additions & 171 deletions lib/src/play_session/play_session_screen.dart

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/src/settings/custom_name_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class _CustomNameDialogState extends State<CustomNameDialog> {

@override
void didChangeDependencies() {
_controller.text = widget.player==Player.player1
_controller.text = widget.player == Player.player1
? context.read<SettingsController>().player1Name.value
: context.read<SettingsController>().player2Name.value;
super.didChangeDependencies();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class LocalStorageSettingsPersistence extends SettingsPersistence {
final prefs = await instanceFuture;
return prefs.getString('player1Name') ?? 'Player1';
}

@override
Future<String> getPlayer2Name() async {
final prefs = await instanceFuture;
Expand Down Expand Up @@ -58,6 +59,7 @@ class LocalStorageSettingsPersistence extends SettingsPersistence {
final prefs = await instanceFuture;
await prefs.setString('player1Name', value);
}

@override
Future<void> savePlayer2Name(String value) async {
final prefs = await instanceFuture;
Expand Down
12 changes: 3 additions & 9 deletions lib/src/settings/settings_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,8 @@ class SettingsScreen extends StatelessWidget {
),
),
_gap,
const _NameChangeLine(
'Player1:',
Player.player1
),
const _NameChangeLine(
'Player2:',
Player.player2
),
const _NameChangeLine('Player1:', Player.player1),
const _NameChangeLine('Player2:', Player.player2),
ValueListenableBuilder<bool>(
valueListenable: settings.soundsOn,
builder: (context, soundsOn, child) => _SettingsLine(
Expand Down Expand Up @@ -130,7 +124,7 @@ class _NameChangeLine extends StatelessWidget {

return InkResponse(
highlightShape: BoxShape.rectangle,
onTap: () => showCustomNameDialog(context,player),
onTap: () => showCustomNameDialog(context, player),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 8),
child: Row(
Expand Down
2 changes: 0 additions & 2 deletions lib/src/style/palette.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,4 @@ class Palette {
void changeRedPen(Color newColor) {
redPen = newColor;
}


}
Binary file modified web/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<!-- Favicon -->
<link rel="icon" type="image/png" href="favicon.png"/>

<title>game_template</title>
<title>Pipo</title>
<link rel="manifest" href="manifest.json">

<script>
Expand Down

0 comments on commit fdb4ce4

Please sign in to comment.