Skip to content

Commit

Permalink
Add shuffle
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeDoctorDE committed May 9, 2023
1 parent 747fab2 commit 613d1ce
Show file tree
Hide file tree
Showing 3 changed files with 1,456 additions and 270 deletions.
35 changes: 20 additions & 15 deletions app/lib/pages/game/cards.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:collection/collection.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:phosphor_flutter/phosphor_flutter.dart';
Expand All @@ -16,14 +17,16 @@ class CardsOperationDialog extends StatelessWidget {
@override
Widget build(BuildContext context) {
int? deckIndex, seatIndex;
bool showRemove =
cards.whereNot((element) => element is AvailableCardIndex).isNotEmpty;
return StatefulBuilder(
builder: (context, setState) => AlertDialog(
title: Text(AppLocalizations.of(context).cardsOperation),
content: SizedBox(
width: 500,
height: 500,
child: DefaultTabController(
length: 3,
length: showRemove ? 3 : 2,
child: Column(
children: [
TabBar(tabs: [
Expand All @@ -33,9 +36,10 @@ class CardsOperationDialog extends StatelessWidget {
Tab(
text: AppLocalizations.of(context).moveToSeatDeck,
),
Tab(
text: AppLocalizations.of(context).remove,
),
if (showRemove)
Tab(
text: AppLocalizations.of(context).remove,
),
]),
Expanded(
child: TabBarView(
Expand Down Expand Up @@ -130,17 +134,18 @@ class CardsOperationDialog extends StatelessWidget {
),
)
]),
ListView(children: [
ElevatedButton(
onPressed: () {
connection.removeCards(cards);
Navigator.pop(context);
},
child: Text(
AppLocalizations.of(context).remove,
),
)
]),
if (showRemove)
ListView(children: [
ElevatedButton(
onPressed: () {
connection.removeCards(cards);
Navigator.pop(context);
},
child: Text(
AppLocalizations.of(context).remove,
),
)
]),
],
),
)
Expand Down
33 changes: 25 additions & 8 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,39 @@
{
"name": "docs",
"name": "butterfly-docs",
"version": "0.0.0",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
"start": "docusaurus start",
"build": "docusaurus build",
"build:meta": "node ./generate_meta.mjs",
"build:docs": "docusaurus build",
"build": "yarn build:meta && yarn build:docs",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
"clear": "docusaurus clear",
"serve": "docusaurus serve",
"lint": "markdownlint-cli2",
"write-translations": "docusaurus write-translations",
"write-heading-ids": "docusaurus write-heading-ids"
},
"dependencies": {
"@docusaurus/core": "2.4.0",
"@docusaurus/plugin-client-redirects": "2.4.0",
"@docusaurus/plugin-content-docs": "2.4.0",
"@docusaurus/plugin-pwa": "2.4.0",
"@docusaurus/preset-classic": "2.4.0",
"@mdx-js/react": "^1.6.22",
"@svgr/webpack": "^7.0.0",
"@docusaurus/theme-common": "2.4.0",
"@mdx-js/react": "^1",
"@swc/core": "^1.3.56",
"animate.css": "^4.1.1",
"clsx": "^1.2.1",
"file-loader": "^6.2.0",
"prism-react-renderer": "^2.0.4",
"node-fetch": "^3.3.1",
"prism-react-renderer": "^2.0.3",
"react": "^18.2.0",
"react-animation-on-scroll": "^5.1.0",
"react-dom": "^18.2.0",
"url-loader": "^4.1.1"
"swc-loader": "^0.2.3",
"ua-parser-js": "^1.0.35"
},
"browserslist": {
"production": [
Expand All @@ -37,5 +47,12 @@
"last 1 safari version"
]
},
"packageManager": "[email protected]"
"packageManager": "[email protected]",
"devDependencies": {
"@docusaurus/module-type-aliases": "2.4.0",
"@tsconfig/docusaurus": "^1.0.7",
"markdownlint-cli2": "^0.7.1",
"typescript": "^5.0.4",
"webpack": "^5.82.0"
}
}
Loading

0 comments on commit 613d1ce

Please sign in to comment.