Skip to content

Commit

Permalink
🚀 Separated Core from UI! Fixed #14!
Browse files Browse the repository at this point in the history
  • Loading branch information
omegaui committed Mar 16, 2023
1 parent 9ea6653 commit 17336f5
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 8 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ Head over to **Releases**
curl "https://raw.githubusercontent.com/omegaui/chat_desk_linux_install_script/main/script/install-linux.sh" | sh
```

### Windows and Mac
Apart from setup, you are required to download `chat_desk_core` at the installation root directory,

Run the following to download it,
```shell
wget https://raw.githubusercontent.com/omegaui/chat_desk_core/main/bin/chat_desk_core.exe
```

## Build From Source

**It's easy**
Expand All @@ -48,6 +56,9 @@ cd chat_desk
- Getting Dependencies
```shell
flutter pub get
wget https://raw.githubusercontent.com/omegaui/chat_desk_core/main/bin/chat_desk_core.exe
# for linux
# sudo chmod 777 chat_desk_core.exe
```

- Launching
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/io/app_style.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:chat_desk/core/io/app_manager.dart';
import 'package:chat_desk/io/app_manager.dart';
import 'package:chat_desk/main.dart';
import 'package:flutter/material.dart';

Expand Down
15 changes: 12 additions & 3 deletions lib/io/server_handler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'dart:convert';
import 'dart:io';

import 'package:chat_desk/core/client/client.dart';
import 'package:chat_desk/core/io/app_manager.dart';
import 'package:chat_desk/io/app_manager.dart';
import 'package:chat_desk/core/io/logger.dart';
import 'package:chat_desk/core/io/message.dart';
import 'package:chat_desk/main.dart';
Expand All @@ -26,8 +26,17 @@ class ServerHandler {
ServerHandler(this.host, this.port);

void start(Function onStartComplete, Function onStartFailed) async {
_serverProcess =
await Process.start('dart', ["lib/core/server/server.dart"]);
var coreFile = File("chat_desk_core.exe");
if (!coreFile.existsSync()) {
print("Core cannot be located!");
print(
"Run the command below in the root directory of installation to download the core:");
print(
"wget https://raw.githubusercontent.com/omegaui/chat_desk_core/main/bin/chat_desk_core.exe");
return;
}
_serverProcess = await Process.start(
"${Platform.isLinux ? "./" : ""}chat_desk_core.exe", []);
_serverProcess.stdout.transform(utf8.decoder).forEach((response) {
try {
dynamic log = jsonDecode(response);
Expand Down
2 changes: 1 addition & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:bitsdojo_window/bitsdojo_window.dart';
import 'package:chat_desk/core/io/app_manager.dart';
import 'package:chat_desk/io/app_manager.dart';
import 'package:chat_desk/io/app_style.dart';
import 'package:chat_desk/ui/app_style_switcher.dart';
import 'package:chat_desk/ui/screens/chat_room/chat_room.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/app_style_switcher.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:chat_desk/core/io/app_manager.dart';
import 'package:chat_desk/io/app_manager.dart';
import 'package:chat_desk/io/app_style.dart';
import 'package:chat_desk/ui/utils.dart';
import 'package:flutter/material.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/screens/chat_room/user_tabs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'dart:convert';
import 'dart:io';

import 'package:chat_desk/core/client/client.dart';
import 'package:chat_desk/core/io/app_manager.dart';
import 'package:chat_desk/io/app_manager.dart';
import 'package:chat_desk/io/app_style.dart';
import 'package:chat_desk/io/server_handler.dart';
import 'package:chat_desk/ui/screens/chat_room/chat_area.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/screens/home_screen.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'dart:io';

import 'package:chat_desk/core/io/app_manager.dart';
import 'package:chat_desk/io/app_manager.dart';
import 'package:chat_desk/core/io/logger.dart';
import 'package:chat_desk/core/server/server.dart';
import 'package:chat_desk/io/app_style.dart';
Expand Down

0 comments on commit 17336f5

Please sign in to comment.