diff --git a/tarok/lib/constants.dart b/tarok/lib/constants.dart
index 2d824ae..3ea1cb9 100644
--- a/tarok/lib/constants.dart
+++ b/tarok/lib/constants.dart
@@ -37,7 +37,7 @@ const WS_URL =
kReleaseMode ? "wss://palcka.si/api/ws" : "ws://localhost:8080/ws";
const LOBBY_WS_URL =
kReleaseMode ? "wss://palcka.si/api/lobby" : "ws://localhost:8080/lobby";
-const RELEASE = "0.1.0";
+const RELEASE = "0.1.1";
bool OMOGOCI_STOCKSKIS_PREDLOGE = true;
bool SLEPI_TAROK = false;
bool AVTOPOTRDI_ZALOZITEV = false;
diff --git a/tarok/lib/game/game_controller.dart b/tarok/lib/game/game_controller.dart
index 877a61f..601a848 100644
--- a/tarok/lib/game/game_controller.dart
+++ b/tarok/lib/game/game_controller.dart
@@ -163,6 +163,11 @@ class GameController extends GetxController {
@override
void onClose() {
+ SystemChrome.setPreferredOrientations([
+ DeviceOrientation.portraitUp,
+ DeviceOrientation.portraitDown,
+ ]);
+
controller.value.dispose();
if (!kIsWeb && (Platform.isLinux || Platform.isWindows)) {
diff --git a/tarok/lib/lobby/friends.dart b/tarok/lib/lobby/friends.dart
index f537bf1..d520d02 100644
--- a/tarok/lib/lobby/friends.dart
+++ b/tarok/lib/lobby/friends.dart
@@ -54,7 +54,7 @@ class Friends extends StatelessWidget {
child: Row(
children: [
const SizedBox(
- width: 100,
+ width: 10,
),
Initicon(
text: e.name,
@@ -95,7 +95,7 @@ class Friends extends StatelessWidget {
},
),
const SizedBox(
- width: 100,
+ width: 10,
),
],
),
@@ -113,7 +113,7 @@ class Friends extends StatelessWidget {
child: Row(
children: [
const SizedBox(
- width: 100,
+ width: 10,
),
Initicon(
text: e.name,
@@ -147,7 +147,7 @@ class Friends extends StatelessWidget {
},
),
const SizedBox(
- width: 100,
+ width: 10,
),
],
),
@@ -165,7 +165,7 @@ class Friends extends StatelessWidget {
child: Row(
children: [
const SizedBox(
- width: 100,
+ width: 10,
),
SizedBox(
height: 70,
@@ -244,7 +244,7 @@ class Friends extends StatelessWidget {
if (gameId != "" && invited.contains(e.id))
const Icon(Icons.check),
const SizedBox(
- width: 100,
+ width: 10,
),
],
),
diff --git a/tarok/lib/lobby/lobby.dart b/tarok/lib/lobby/lobby.dart
index 12d1a3f..ca07581 100644
--- a/tarok/lib/lobby/lobby.dart
+++ b/tarok/lib/lobby/lobby.dart
@@ -14,14 +14,11 @@
// along with this program. If not, see .
import 'package:flutter/material.dart';
-import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:get/get.dart' hide FormData;
import 'package:stockskis/stockskis.dart' hide Card, debugPrint;
-import 'package:tarok/constants.dart';
import 'package:tarok/lobby/lobby_controller.dart';
-import 'package:tarok/replay.dart';
+import 'package:tarok/lobby/lobby_ui.dart';
import 'package:tarok/ui/main_page.dart';
-import 'package:url_launcher/url_launcher.dart';
Future preloadCards(BuildContext context) async {
for (int i = 0; i < CARDS.length; i++) {
@@ -46,633 +43,10 @@ class Lobby extends StatelessWidget {
tooltip: "new_game".tr,
child: const Icon(Icons.add),
),
- child: Obx(
- () => Row(
- children: [
- Expanded(
- child: Center(
- child: ListView(
- shrinkWrap: true,
- children: [
- Center(
- child: Text(
- "welcome_message".tr,
- style: const TextStyle(fontSize: 40),
- ),
- ),
- if (controller.guest.value)
- Center(
- child: Text(
- "using_guest_access".tr,
- style: const TextStyle(fontSize: 20),
- ),
- ),
- Center(
- child: Text(
- "games_available".tr,
- style: const TextStyle(fontSize: 30),
- ),
- ),
- if (!controller.guest.value)
- Row(
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- Text("with_players".tr),
- const SizedBox(
- width: 10,
- ),
- ElevatedButton.icon(
- onPressed: () =>
- controller.quickGameFind(3, "normal"),
- label: Text(
- "in_three".tr,
- style: const TextStyle(
- fontSize: 20,
- ),
- ),
- icon: const Icon(Icons.face),
- ),
- ElevatedButton.icon(
- onPressed: () =>
- controller.quickGameFind(4, "normal"),
- label: Text(
- "in_four".tr,
- style: const TextStyle(
- fontSize: 20,
- ),
- ),
- icon: const Icon(Icons.face),
- ),
- ]),
- if (!controller.guest.value)
- Row(
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- Text("chatroom".tr),
- const SizedBox(
- width: 10,
- ),
- ElevatedButton.icon(
- onPressed: () =>
- controller.quickGameFind(3, "klepetalnica"),
- label: Text(
- "in_three".tr,
- style: const TextStyle(
- fontSize: 20,
- ),
- ),
- icon: const Icon(Icons.face),
- ),
- ElevatedButton.icon(
- onPressed: () =>
- controller.quickGameFind(4, "klepetalnica"),
- label: Text(
- "in_four".tr,
- style: const TextStyle(
- fontSize: 20,
- ),
- ),
- icon: const Icon(Icons.face),
- ),
- ]),
- Row(mainAxisAlignment: MainAxisAlignment.center, children: [
- Text("with_bots".tr),
- const SizedBox(
- width: 10,
- ),
- ElevatedButton.icon(
- onPressed: () => controller.botGame(3),
- label: Text(
- "in_three".tr,
- style: const TextStyle(
- fontSize: 20,
- ),
- ),
- icon: const Icon(Icons.smart_toy),
- ),
- ElevatedButton.icon(
- onPressed: () => controller.botGame(4),
- label: Text(
- "in_four".tr,
- style: const TextStyle(
- fontSize: 20,
- ),
- ),
- icon: const Icon(Icons.smart_toy),
- ),
- ]),
- if (!controller.guest.value)
- const SizedBox(
- height: 10,
- ),
- if (!controller.guest.value)
- Center(
- child: ElevatedButton(
- onPressed: () => Get.defaultDialog(
- title: "replay".tr,
- content: SingleChildScrollView(
- child: Obx(
- () => Column(children: [
- Text("replay_desc".tr),
- const SizedBox(
- height: 10,
- ),
- Row(children: [
- Expanded(
- child: TextField(
- controller:
- controller.replayController.value,
- decoration: InputDecoration(
- border: const UnderlineInputBorder(),
- labelText: "replay_link".tr,
- ),
- ),
- ),
- ]),
- ]),
- ),
- ),
- actions: [
- TextButton(
- onPressed: () {
- Get.back();
- },
- child: Text("cancel".tr),
- ),
- TextButton(
- onPressed: () {
- joinReplay(
- controller.replayController.value.text);
- },
- child: Text("ok".tr),
- ),
- ],
- ),
- child: Text("replay".tr),
- ),
- ),
- const SizedBox(
- height: 10,
- ),
- Center(
- child: ElevatedButton(
- onPressed: () => showDialog(
- context: context,
- builder: (context) {
- return StatefulBuilder(
- builder: (context, setState) {
- return AlertDialog(
- title: Text("modify_bots".tr),
- content: SingleChildScrollView(
- child: Obx(
- () => Column(children: [
- Text("modify_bots_desc".tr),
- const SizedBox(
- height: 10,
- ),
- FutureBuilder(
- future: controller.getBots(),
- builder: (BuildContext context,
- AsyncSnapshot snapshot) {
- if (controller
- .botNames.isNotEmpty) {
- return DataTable(
- columns: [
- DataColumn(
- label: Expanded(
- child: Text(
- "bot".tr,
- style: const TextStyle(
- fontStyle: FontStyle
- .italic),
- ),
- ),
- ),
- DataColumn(
- label: Expanded(
- child: Text(
- "name".tr,
- style: const TextStyle(
- fontStyle: FontStyle
- .italic),
- ),
- ),
- ),
- DataColumn(
- label: Expanded(
- child: Text(
- "remove".tr,
- style: const TextStyle(
- fontStyle: FontStyle
- .italic),
- ),
- ),
- ),
- ],
- rows: [
- ...controller.botNames.map(
- (e) => DataRow(
- cells: [
- DataCell(
- Text(e["type"])),
- DataCell(
- Text(e["name"])),
- DataCell(
- IconButton(
- icon: const Icon(
- Icons.delete),
- onPressed:
- () async {
- await controller
- .deleteBot(
- e["name"],
- e["type"],
- );
- await controller
- .getBots();
- setState(() {});
- },
- ),
- ),
- ],
- ),
- ),
- ],
- );
- }
- return const SizedBox();
- },
- ),
- Row(children: [
- Expanded(
- child: TextField(
- controller: controller
- .playerNameController.value,
- decoration: InputDecoration(
- border:
- const UnderlineInputBorder(),
- labelText: "bot_name".tr,
- ),
- ),
- ),
- IconButton(
- icon: const Icon(
- Icons.replay_outlined),
- onPressed: () async {
- String botName =
- controller.randomBotName();
- controller.playerNameController
- .value.text = botName;
- setState(() {});
- },
- ),
- ]),
- const SizedBox(
- height: 10,
- ),
- Center(
- child: SegmentedButton