-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
85 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
FROM debian:stable | ||
|
||
WORKDIR /usr/vscode | ||
|
||
ENV ANDROID_HOME="/usr/lib/android-sdk" | ||
# install Android sdk & cmdline tools without Android Studio | ||
RUN apt-get update && \ | ||
apt-get install -y wget tar xz-utils unzip git && \ | ||
apt-get install -y android-sdk && \ | ||
wget https://dl.google.com/android/repository/commandlinetools-linux-10406996_latest.zip && \ | ||
unzip commandlinetools-linux-10406996_latest.zip && \ | ||
mkdir -p "${ANDROID_HOME}/cmdline-tools/latest" && \ | ||
mv cmdline-tools/* "${ANDROID_HOME}/cmdline-tools/latest" && \ | ||
rm -rf cmdline-tools | ||
|
||
ENV PATH="${ANDROID_HOME}/cmdline-tools/latest/bin:${PATH}" | ||
RUN yes | sdkmanager --licenses && sdkmanager --install "platforms;android-33" | ||
|
||
# download and extract to "flutter" folder | ||
RUN wget https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.13.3-stable.tar.xz && \ | ||
tar vxfo flutter_linux_3.13.3-stable.tar.xz | ||
|
||
ENV PATH="${PATH}:/usr/vscode/flutter/bin" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,45 @@ | ||
# Simple-POS | ||
|
||
### ❤️❤️ [Online Demo](https://tcd93.github.io/flutter-pos)❤️❤️ | ||
|
||
A mobile POS written in _Flutter_, suitable for small cafe/restaurant, fully offline. | ||
|
||
**Tested & printable on **Sunmi V1S** device.** | ||
|
||
![sunmi_v1s](.github/resource/print.jpg) | ||
|
||
**Support:** | ||
|
||
- Android | ||
- Web (unable to print) | ||
- English & Vietnamese (auto detect Locale) | ||
|
||
--- | ||
|
||
## Install & Run | ||
|
||
Get [flutter](https://flutter.dev/) 3.10 | ||
|
||
``` | ||
flutter pub get | ||
flutter run | ||
``` | ||
|
||
**For web** | ||
1. `flutter run -d chrome` | ||
|
||
**For Android** | ||
**Requirement: JAVA sdk >=18** | ||
1. `flutter run` | ||
|
||
## Testing | ||
`flutter test` | ||
|
||
## TODO | ||
- [ ] Remote printing? (via Bluetooth) | ||
# Simple-POS | ||
|
||
### ❤️❤️ [Online Demo](https://tcd93.github.io/flutter-pos)❤️❤️ | ||
|
||
A mobile POS written in _Flutter_, suitable for small cafe/restaurant, fully offline. | ||
|
||
**Tested & printable on **Sunmi V1S** device.** | ||
|
||
![sunmi_v1s](.github/resource/print.jpg) | ||
|
||
**Support:** | ||
|
||
- Android | ||
- Web (unable to print) | ||
- English & Vietnamese (auto detect Locale) | ||
|
||
--- | ||
|
||
## Install & Run | ||
|
||
Get [flutter](https://flutter.dev/) | ||
**IMPORTANT: this project works only with Flutter >= 3.10** | ||
|
||
``` | ||
flutter pub get | ||
flutter run | ||
``` | ||
|
||
### Running inside WSL2 | ||
##### Use **Docker for Destop**'s _Dev Environment_ (note that usbip over Docker Desktop, as of now, hasn't work; you can try debugging over ADB tcpip) | ||
Or | ||
##### Run Docker containers inside of WSL2 | ||
1. Build image and run container: `docker-compose -f .\compose-dev.yaml up -d --build` | ||
2. SSH inside: `docker exec -it flutter_dev bash` | ||
3. Accept licences: `flutter doctor --android-licenses` | ||
4. Clean: `flutter clean` | ||
5. Run: | ||
- Web: `flutter run -d web-server` (Visual studio code should forward the port automatically if you use _Remote window_) | ||
- USB-connected Android device: follow the instruction [here](https://learn.microsoft.com/en-us/windows/wsl/connect-usb) to connect your phone into WSL2, remember to kill the running ADB server on your Windows host machine first | ||
|
||
## Testing | ||
`flutter test` | ||
|
||
## TODO | ||
- [ ] Remote printing? (via Bluetooth) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
services: | ||
flutter: | ||
container_name: flutter_dev | ||
privileged: true | ||
entrypoint: | ||
- sleep | ||
- infinity | ||
build: . | ||
init: true | ||
volumes: | ||
- type: bind | ||
source: /var/run/docker.sock | ||
target: /var/run/docker.sock | ||
- ./:/usr/vscode/pos_app | ||
- ./:/com.docker.devenvironments.code | ||
working_dir: /usr/vscode/pos_app |