Skip to content

Commit

Permalink
Add docs custom styling
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeDoctorDE committed May 10, 2023
1 parent c933e50 commit 5d71563
Show file tree
Hide file tree
Showing 20 changed files with 876 additions and 156 deletions.
4 changes: 2 additions & 2 deletions app/AppImageBuilder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ version: 1
script:
- rm -rf AppDir || true
- cp -r build/linux/x64/release/bundle AppDir
- mkdir -p AppDir/usr/share/icons/hicolor/64x64/apps/
- cp linux/debian/usr/share/icons/hicolor AppDir/usr/share/icons/hicolor -r
#- mkdir -p AppDir/usr/share/icons/hicolor/64x64/apps/
#- cp linux/debian/usr/share/icons/hicolor AppDir/usr/share/icons/hicolor -r
AppDir:
path: ./AppDir
app_info:
Expand Down
2 changes: 1 addition & 1 deletion app/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ android {
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "dev.linwood.qeck"
minSdkVersion flutter.minSdkVersion
minSdkVersion 19
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
Expand Down
3 changes: 2 additions & 1 deletion app/lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,6 @@
"changeVisibility": "Change visibility",
"change": "Change",
"secure": "Secure",
"port": "Port"
"port": "Port",
"otherSeats": "Other seats"
}
96 changes: 51 additions & 45 deletions app/lib/pages/game/deck.dart
Original file line number Diff line number Diff line change
Expand Up @@ -173,50 +173,56 @@ class CardDeckDialog extends StatelessWidget {
Align(
child: ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 500, maxHeight: 500),
child: Material(
child: SingleChildScrollView(
child: StreamBuilder<GameState>(
stream: connection.stateStream,
builder: (context, snapshot) {
if (!snapshot.hasData) {
return const SizedBox();
}
final state = snapshot.data;
var realDeck = deck;
if (seatIndex != null) {
realDeck = state!.seats[seatIndex!].decks[index!];
} else if (index != null) {
realDeck = state!.decks[index!];
}
return Wrap(
children: realDeck.cards
.asMap()
.entries
.map((e) => InkWell(
onTap: () {
CardIndex cardIndex;
if (index == null) {
cardIndex = AvailableCardIndex(e.value);
} else if (seatIndex == null) {
cardIndex = DeckCardIndex(e.key, index!);
} else {
cardIndex = SeatCardIndex(
e.key, index!, seatIndex!);
}
showDialog(
context: context,
builder: (context) =>
CardsOperationDialog(
cards: [cardIndex],
connection: connection));
},
child: CardView(
card: e.value,
),
))
.toList(),
);
}),
child: Card(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: SingleChildScrollView(
child: StreamBuilder<GameState>(
stream: connection.stateStream,
builder: (context, snapshot) {
if (!snapshot.hasData) {
return const SizedBox();
}
final state = snapshot.data;
var realDeck = deck;
if (seatIndex != null) {
realDeck = state!.seats[seatIndex!].decks[index!];
} else if (index != null) {
realDeck = state!.decks[index!];
}
return Wrap(
spacing: 8,
runSpacing: 8,
children: realDeck.cards
.asMap()
.entries
.map((e) => InkWell(
onTap: () {
CardIndex cardIndex;
if (index == null) {
cardIndex = AvailableCardIndex(e.value);
} else if (seatIndex == null) {
cardIndex =
DeckCardIndex(e.key, index!);
} else {
cardIndex = SeatCardIndex(
e.key, index!, seatIndex!);
}
showDialog(
context: context,
builder: (context) =>
CardsOperationDialog(
cards: [cardIndex],
connection: connection));
},
child: CardView(
card: e.value,
),
))
.toList(),
);
}),
),
),
),
),
Expand All @@ -234,7 +240,7 @@ class AddDeckView extends StatelessWidget {
@override
Widget build(BuildContext context) {
return SizedBox(
width: 120,
width: 150,
child: Card(
clipBehavior: Clip.antiAlias,
child: InkWell(
Expand Down
100 changes: 72 additions & 28 deletions app/lib/pages/game/seat.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,47 @@ import 'package:phosphor_flutter/phosphor_flutter.dart';
import 'package:qeck/logic/connection/client.dart';
import 'package:qeck/logic/state.dart';

import 'deck.dart';

class SeatView extends StatelessWidget {
final ClientGameConnection connection;
final GameSeat seat;
final int index;

const SeatView({
super.key,
required this.connection,
required this.seat,
required this.index,
});

@override
Widget build(BuildContext context) {
return Column(
mainAxisSize: MainAxisSize.min,
children: [
Text(seat.name),
SizedBox(
height: 150,
child: ListView(
shrinkWrap: true,
scrollDirection: Axis.horizontal,
children: [
...seat.decks.asMap().entries.map((e) => GameDeckView(
connection: connection,
deck: e.value,
index: e.key,
seatIndex: index,
)),
AddDeckView(connection: connection, seatIndex: index),
],
),
),
],
);
}
}

class SeatsDialog extends StatelessWidget {
final ClientGameConnection connection;

Expand All @@ -19,37 +60,40 @@ class SeatsDialog extends StatelessWidget {
child: StreamBuilder<GameState>(
stream: connection.stateStream,
builder: (context, snapshot) {
final state = snapshot.data!;
final state = snapshot.data;
return Column(
mainAxisSize: MainAxisSize.min,
children: [
...state.seats.asMap().entries.map(
(e) {
final seat = e.value;
final selected =
seat.players.contains(connection.playerId);
return ListTile(
title: Text(seat.name),
selected: selected,
leading: selected
? IconButton(
icon:
const PhosphorIcon(PhosphorIconsLight.door),
onPressed: () => connection.leaveSeat(e.key),
)
: IconButton(
icon: const PhosphorIcon(
PhosphorIconsLight.doorOpen),
onPressed: () => connection.joinSeat(e.key),
),
trailing: IconButton(
icon: const PhosphorIcon(PhosphorIconsLight.trash),
onPressed: () => connection.removeSeat(e.key),
),
);
},
),
if (connection.state.seats.isNotEmpty) const Divider(),
...(state?.seats.asMap().entries.map(
(e) {
final seat = e.value;
final selected =
seat.players.contains(connection.playerId);
return ListTile(
title: Text(seat.name),
selected: selected,
leading: selected
? IconButton(
icon: const PhosphorIcon(
PhosphorIconsLight.door),
onPressed: () =>
connection.leaveSeat(e.key),
)
: IconButton(
icon: const PhosphorIcon(
PhosphorIconsLight.doorOpen),
onPressed: () => connection.joinSeat(e.key),
),
trailing: IconButton(
icon:
const PhosphorIcon(PhosphorIconsLight.trash),
onPressed: () => connection.removeSeat(e.key),
),
);
},
) ??
[]),
if (state?.seats.isNotEmpty ?? false) const Divider(),
ListTile(
title: Text(AppLocalizations.of(context).create),
trailing: const Icon(Icons.add),
Expand Down
Loading

1 comment on commit 5d71563

@vercel
Copy link

@vercel vercel bot commented on 5d71563 May 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

qeck – ./app

qeck.vercel.app
qeck-git-develop-linwood.vercel.app
qeck-linwood.vercel.app

Please sign in to comment.